Skip to content
Extraits de code Groupes Projets
Valider 0ce0e47f rédigé par Maxwell Salzberg's avatar Maxwell Salzberg
Parcourir les fichiers

fix #2698; allow a user to delete a reshare of a deleted post

parent 838da1fd
Aucune branche associée trouvée
Aucune étiquette associée trouvée
Aucune requête de fusion associée trouvée
......@@ -22,7 +22,7 @@ class Reshare < Post
end
after_destroy do
self.root.update_reshares_counter
self.root.update_reshares_counter if self.root.present?
end
def root_diaspora_id
......
......@@ -105,6 +105,17 @@ describe Reshare do
end
end
describe 'destroy' do
it 'allows you to destroy the reshare if the root post is missing' do
reshare = Factory(:reshare)
reshare.root = nil
expect{
reshare.destroy
}.should_not raise_error
end
end
context 'remote' do
before do
@root_object = @reshare.root
......
0% Chargement en cours ou .
You are about to add 0 people to the discussion. Proceed with caution.
Terminez d'abord l'édition de ce message.
Veuillez vous inscrire ou vous pour commenter