FEATURE: remove support for 'suppress_from_latest' category setting. (#8308)

This commit is contained in:
Vinoth Kannan
2019-11-18 12:28:35 +05:30
committed by GitHub
parent 4e4844f4db
commit 3bb7ad4be1
20 changed files with 64 additions and 182 deletions

View File

@ -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)