Skip to content
Extraits de code Groupes Projets
Valider 1a93ccd5 rédigé par Jonne Haß's avatar Jonne Haß Validation de Florian Staudacher
Parcourir les fichiers

don't error out if the root of a reshare of a reshare got deleted, fixes #3546

parent 6ba10a4a
Aucune branche associée trouvée
Aucune étiquette associée trouvée
Aucune requête de fusion associée trouvée
...@@ -30,6 +30,10 @@ ...@@ -30,6 +30,10 @@
* Fix javascripts error in invitations facebox. [#3638](https://github.com/diaspora/diaspora/pull/3638) * Fix javascripts error in invitations facebox. [#3638](https://github.com/diaspora/diaspora/pull/3638)
* Fix css overflow problem in aspect dropdown on welcome page. [#3637](https://github.com/diaspora/diaspora/pull/3637) * Fix css overflow problem in aspect dropdown on welcome page. [#3637](https://github.com/diaspora/diaspora/pull/3637)
# 0.0.1.2
Fix exception when the root of a reshare of a reshare got deleted [#3546](https://github.com/diaspora/diaspora/issues/3546)
# 0.0.1.1 # 0.0.1.1
* Fix syntax error in French Javascript pluralization rule. * Fix syntax error in French Javascript pluralization rule.
......
...@@ -63,7 +63,7 @@ class PostPresenter ...@@ -63,7 +63,7 @@ class PostPresenter
end end
def root def root
PostPresenter.new(@post.absolute_root, current_user).as_json if @post.respond_to?(:root) && @post.root.present? PostPresenter.new(@post.absolute_root, current_user).as_json if @post.respond_to?(:absolute_root) && @post.absolute_root.present?
end end
def user_like def user_like
......
...@@ -44,6 +44,16 @@ describe PostPresenter do ...@@ -44,6 +44,16 @@ describe PostPresenter do
end end
describe '#root' do describe '#root' do
it 'does not raise if the absolute_root does not exists' do
first_reshare = FactoryGirl.create :reshare
first_reshare.root = nil
reshare = FactoryGirl.create :reshare, :root => first_reshare
expect {
PostPresenter.new(reshare).root
}.to_not raise_error
end
it 'does not raise if the root does not exists' do it 'does not raise if the root does not exists' do
reshare = FactoryGirl.create:reshare reshare = FactoryGirl.create:reshare
reshare.root = nil reshare.root = nil
......
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