FIX: Recovered posts with no user will be taken over by system user (#8834)

This commit is contained in:
Dan Ungureanu
2020-02-06 10:19:04 +02:00
committed by GitHub
parent 8ca9ad887d
commit c5e3faac00
5 changed files with 15 additions and 4 deletions

View File

@ -1159,7 +1159,7 @@ describe Guardian do
PostDestroyer.new(moderator, topic.first_post).destroy
topic.first_post.user.destroy!
expect(Guardian.new(moderator).can_recover_topic?(topic.reload)).to be_falsey
expect(Guardian.new(moderator).can_recover_topic?(topic.reload)).to be_truthy
end
end
end
@ -1199,7 +1199,7 @@ describe Guardian do
PostDestroyer.new(moderator, post).destroy
post.user.destroy!
expect(Guardian.new(moderator).can_recover_post?(post.reload)).to be_falsey
expect(Guardian.new(moderator).can_recover_post?(post.reload)).to be_truthy
end
end
end