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 ...@@ -22,7 +22,7 @@ class Reshare < Post
end end
after_destroy do after_destroy do
self.root.update_reshares_counter self.root.update_reshares_counter if self.root.present?
end end
def root_diaspora_id def root_diaspora_id
......
...@@ -105,6 +105,17 @@ describe Reshare do ...@@ -105,6 +105,17 @@ describe Reshare do
end end
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 context 'remote' do
before do before do
@root_object = @reshare.root @root_object = @reshare.root
......
0% Chargement en cours ou .
You are about to add 0 people to the discussion. Proceed with caution.
Veuillez vous inscrire ou vous pour commenter