mirror of
https://github.com/discourse/discourse.git
synced 2025-05-30 07:11:34 +08:00
FEATURE: remove support for 'suppress_from_latest' category setting. (#8308)
This commit is contained in:
@ -12,10 +12,6 @@ describe CategoryFeaturedTopic do
|
||||
fab!(:category) { Fabricate(:category) }
|
||||
let!(:category_post) { PostCreator.create(user, raw: "I put this post in the category", title: "categorize THIS", category: category.id) }
|
||||
|
||||
before do
|
||||
CategoryFeaturedTopic.clear_exclude_category_ids
|
||||
end
|
||||
|
||||
it "works in batched mode" do
|
||||
category2 = Fabricate(:category)
|
||||
post2 = create_post(category: category2.id)
|
||||
@ -57,20 +53,6 @@ describe CategoryFeaturedTopic do
|
||||
expect(CategoryFeaturedTopic.count).to be(1)
|
||||
end
|
||||
|
||||
it 'should not include topics from suppressed categories' do
|
||||
CategoryFeaturedTopic.feature_topics_for(category)
|
||||
expect(
|
||||
CategoryFeaturedTopic.where(category_id: category.id).order('rank asc').pluck(:topic_id)
|
||||
).to contain_exactly(category_post.topic.id)
|
||||
|
||||
category.update(suppress_from_latest: true)
|
||||
|
||||
CategoryFeaturedTopic.feature_topics_for(category)
|
||||
expect(
|
||||
CategoryFeaturedTopic.where(category_id: category.id).order('rank asc').pluck(:topic_id)
|
||||
).to_not contain_exactly(category_post.topic.id)
|
||||
end
|
||||
|
||||
it 'should feature stuff in the correct order' do
|
||||
category = Fabricate(:category, num_featured_topics: 2)
|
||||
_t5 = Fabricate(:topic, category_id: category.id, bumped_at: 12.minutes.ago)
|
||||
|
Reference in New Issue
Block a user