mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
FIX: You shouldn't be able to add a parent to Uncategorized
This commit is contained in:
@@ -116,7 +116,7 @@ describe Category do
|
||||
end
|
||||
|
||||
it "lists all secured categories correctly" do
|
||||
uncategorized = Category.first
|
||||
uncategorized = Category.find(SiteSetting.uncategorized_category_id)
|
||||
|
||||
group.add(user)
|
||||
category.set_permissions(group.id => :full)
|
||||
@@ -370,6 +370,19 @@ describe Category do
|
||||
end
|
||||
end
|
||||
|
||||
describe "uncategorized" do
|
||||
let(:cat) { Category.where(id: SiteSetting.uncategorized_category_id).first }
|
||||
|
||||
it "reports as `uncategorized?`" do
|
||||
cat.should be_uncategorized
|
||||
end
|
||||
|
||||
it "cannot have a parent category" do
|
||||
cat.parent_category_id = Fabricate(:category).id
|
||||
cat.should_not be_valid
|
||||
end
|
||||
end
|
||||
|
||||
describe "parent categories" do
|
||||
let(:user) { Fabricate(:user) }
|
||||
let(:parent_category) { Fabricate(:category, user: user) }
|
||||
|
||||
Reference in New Issue
Block a user