mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
Add a spec for category list with empty category
This commit is contained in:
@@ -50,11 +50,18 @@ describe CategoryList do
|
||||
category_list.categories.should be_blank
|
||||
end
|
||||
|
||||
it "returns empty categories for those who can create them" do
|
||||
it "returns empty the empty for those who can create them" do
|
||||
Guardian.any_instance.expects(:can_create?).with(Category).returns(true)
|
||||
category_list.categories.should_not be_blank
|
||||
end
|
||||
|
||||
it 'returns the empty category and a non-empty category for those who can create them' do
|
||||
category_with_topics = Fabricate(:topic, category: Fabricate(:category))
|
||||
Guardian.any_instance.expects(:can_create?).with(Category).returns(true)
|
||||
category_list.categories.should have(2).categories
|
||||
category_list.categories.should include(topic_category)
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
|
||||
@@ -75,8 +82,6 @@ describe CategoryList do
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
end
|
||||
|
||||
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user