mirror of
https://github.com/discourse/discourse.git
synced 2025-09-06 10:50:21 +08:00
DEV: trash category definition topic instead of destroying. (#14356)
After deleting a category, we should soft-delete the category definition topic instead of hard deleting it. Else it causes issues while doing the user merge action if the source user has an orphan post that belongs to the deleted topic.
This commit is contained in:
parent
a29a6522d0
commit
a8b2e7e343
2 changed files with 7 additions and 2 deletions
|
@ -538,7 +538,7 @@ describe Category do
|
|||
it 'is deleted correctly' do
|
||||
@category.destroy
|
||||
expect(Category.exists?(id: @category_id)).to be false
|
||||
expect(Topic.exists?(id: @topic_id)).to be false
|
||||
expect(Topic.with_deleted.where.not(deleted_at: nil).exists?(id: @topic_id)).to be true
|
||||
expect(SiteSetting.shared_drafts_category).to be_blank
|
||||
end
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue