FIX: Close topics deleted by users and ensure topic stubs are destroyed. (#7430)

This commit is contained in:
Bianca Nenciu
2019-05-07 16:25:52 +03:00
committed by GitHub
parent 1b7be1500f
commit 98a75906c8
3 changed files with 15 additions and 3 deletions

View File

@@ -52,6 +52,16 @@ describe PostDestroyer do
end
describe 'destroy_old_stubs' do
it 'destroys stubs for deleted by user topics' do
SiteSetting.delete_removed_posts_after = 24
PostDestroyer.new(post.user, post).destroy
post.update_column(:updated_at, 2.days.ago)
PostDestroyer.destroy_stubs
expect(post.reload.deleted_at).not_to eq(nil)
end
it 'destroys stubs for deleted by user posts' do
SiteSetting.delete_removed_posts_after = 24
Fabricate(:admin)