FIX: Respect show_category_definitions_in_topic_lists in category lists (#10853)

When that site setting is enabled, the category counts (new/unread)
include the subcategory definition topics, but the topics aren't included
in the list. This fixes that discrepancy.
This commit is contained in:
Penar Musaraj
2020-10-07 14:19:48 -04:00
committed by GitHub
parent 3e8561daaf
commit ddd6c990f6
2 changed files with 9 additions and 5 deletions

View File

@ -217,6 +217,11 @@ describe TopicQuery do
expect(TopicQuery.new(moderator, category: category.id, no_subcategories: true).list_latest.topics.size).to eq(1)
end
it "shows a subcategory definition topic in its parent list with the right site setting" do
SiteSetting.show_category_definitions_in_topic_lists = true
expect(TopicQuery.new(moderator, category: category.id).list_latest.topics.size).to eq(2)
end
it "works with subsubcategories" do
SiteSetting.max_category_nesting = 3