mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
FIX: categories created by users who are deleted cannot be deleted
This commit is contained in:
@@ -238,6 +238,17 @@ describe UserDestroyer do
|
||||
UserDestroyer.new(@admin).destroy(@user, {block_ip: true})
|
||||
end
|
||||
end
|
||||
|
||||
context 'user created a category' do
|
||||
let!(:category) { Fabricate(:category, user: @user) }
|
||||
|
||||
it "assigns the system user to the categories" do
|
||||
UserDestroyer.new(@admin).destroy(@user, {delete_posts: true})
|
||||
category.reload.user_id.should == Discourse.system_user.id
|
||||
category.topic.should be_present
|
||||
category.topic.user_id.should == Discourse.system_user.id
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user