forked from discourse/discourse
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
FIX: muted tags breaking hot page when filtered to tags (discourse#25824
) Also, remove experimental setting and simply use top_menu for feature detection This means that when people eventually enable the hot top menu, there will be topics in it Co-authored-by: Alan Guo Xiang Tan <[email protected]>
- Loading branch information
1 parent
b2a2203
commit 207cb20
Showing
9 changed files
with
75 additions
and
25 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
# frozen_string_literal: true | ||
|
||
require "file_store/s3_store" | ||
|
||
RSpec.describe Jobs::UpdateTopicHotScores do | ||
use_redis_snapshotting | ||
let(:job) { subject } | ||
|
||
fab!(:topic) { Fabricate(:topic, created_at: 1.day.ago) } | ||
|
||
it "runs an update even if hot is missing from top_menu (once every 6 hours)" do | ||
SiteSetting.top_menu = "latest" | ||
job.execute({}) | ||
|
||
expect(TopicHotScore.where(topic_id: topic.id).count).to eq(1) | ||
|
||
topic2 = Fabricate(:topic, created_at: 1.hour.ago) | ||
job.execute({}) | ||
|
||
expect(TopicHotScore.where(topic_id: topic2.id).count).to eq(0) | ||
end | ||
|
||
it "runs an update unconditionally if hot is in top menu" do | ||
SiteSetting.top_menu = "latest|hot" | ||
job.execute({}) | ||
|
||
expect(TopicHotScore.where(topic_id: topic.id).count).to eq(1) | ||
|
||
topic2 = Fabricate(:topic, created_at: 1.hour.ago) | ||
job.execute({}) | ||
|
||
expect(TopicHotScore.where(topic_id: topic2.id).count).to eq(1) | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters