File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -115,7 +115,7 @@ def add_uncategorized
115115 def prune_empty
116116 unless @guardian . can_create? ( Category )
117117 # Remove categories with no featured topics unless we have the ability to edit one
118- @categories . delete_if { |c | c . displayable_topics . blank? }
118+ @categories . delete_if { |c | c . displayable_topics . blank? && c . description . nil? }
119119 end
120120 end
121121
Original file line number Diff line number Diff line change 6161 category_list . categories . should be_blank
6262 end
6363
64- it "returns empty the empty for those who can create them" do
64+ it "returns empty categories for those who can create them" do
6565 Guardian . any_instance . expects ( :can_create? ) . with ( Category ) . returns ( true )
6666 category_list . categories . should_not be_blank
6767 end
6868
69+ it "returns empty categories with descriptions" do
70+ Fabricate ( :category , description : 'The category description.' )
71+ Guardian . any_instance . expects ( :can_create? ) . with ( Category ) . returns ( false )
72+ category_list . categories . should_not be_blank
73+ end
74+
6975 it 'returns the empty category and a non-empty category for those who can create them' do
7076 category_with_topics = Fabricate ( :topic , category : Fabricate ( :category ) )
7177 Guardian . any_instance . expects ( :can_create? ) . with ( Category ) . returns ( true )
You can’t perform that action at this time.
0 commit comments