FIX: Avoid the deleted_at scope when recovering a topic from a recently recovered post

This commit is contained in:
Roman Rizzi
2019-03-29 10:36:29 -03:00
committed by Robin Ward
parent d26d1b387e
commit 7740b1570b
2 changed files with 12 additions and 1 deletions

View File

@ -177,6 +177,17 @@ describe PostDestroyer do
expect(@user.user_stat.post_count).to eq(1)
end
it 'Recovers the post correctly' do
PostDestroyer.new(admin, post).destroy
post.reload
PostDestroyer.new(admin, post).recover
recovered_topic = post.reload.topic
expect(recovered_topic.deleted_at).to be_nil
expect(recovered_topic.deleted_by_id).to be_nil
end
context "recovered by user" do
it "should increment the user's post count" do
PostDestroyer.new(@user, @reply).destroy