mirror of
https://github.com/discourse/discourse.git
synced 2025-05-30 07:11:34 +08:00
Prevent deleting 'uncategorized' category
This commit is contained in:
@ -800,6 +800,12 @@ describe Guardian do
|
||||
Guardian.new(moderator).can_delete?(category).should be_false
|
||||
end
|
||||
|
||||
it "can't be deleted if it is the Uncategorizied Category" do
|
||||
uncategorized_cat_id = SiteSetting.uncategorized_category_id
|
||||
uncategorized_category = Category.find(uncategorized_cat_id)
|
||||
Guardian.new(admin).can_delete?(uncategorized_category).should be_false
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
context 'can_suspend?' do
|
||||
|
Reference in New Issue
Block a user