mirror of
https://github.com/codeninjasllc/discourse.git
synced 2024-11-23 23:58:31 -05:00
Don't show invisible topics in uncategorized on categories page
This commit is contained in:
parent
455742d3ee
commit
bfdbf373f3
2 changed files with 8 additions and 1 deletions
|
@ -68,6 +68,7 @@ class CategoryList
|
|||
# Support for uncategorized topics
|
||||
uncategorized_topics = Topic
|
||||
.listable_topics
|
||||
.visible
|
||||
.where(category_id: nil)
|
||||
.topic_list_order
|
||||
.limit(SiteSetting.category_featured_topics)
|
||||
|
|
|
@ -12,7 +12,7 @@ describe CategoryList do
|
|||
category_list.categories.should be_blank
|
||||
end
|
||||
|
||||
context "with an uncateorized topic" do
|
||||
context "with an uncategorized topic" do
|
||||
let!(:topic) { Fabricate(:topic)}
|
||||
let(:category) { category_list.categories.first }
|
||||
|
||||
|
@ -24,6 +24,12 @@ describe CategoryList do
|
|||
category.featured_topics.should == [topic]
|
||||
end
|
||||
|
||||
it 'does not return an invisible topic' do
|
||||
invisible_topic = Fabricate(:topic)
|
||||
invisible_topic.update_status('visible', false, Fabricate(:admin))
|
||||
expect(category.featured_topics).to_not include(invisible_topic)
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue