mirror of
https://github.com/discourse/discourse.git
synced 2025-06-02 16:29:32 +08:00
DEV: Publish DiscourseEvent after top topic period is calculated (#29142)
This commit is contained in:

committed by
GitHub

parent
374238b910
commit
909264ee75
@ -152,5 +152,12 @@ RSpec.describe TopTopic do
|
||||
0.0000000001,
|
||||
).of(10.602059991328)
|
||||
end
|
||||
|
||||
it "triggers a DiscourseEvent for each refreshed period" do
|
||||
events = DiscourseEvent.track_events(:top_score_computed) { TopTopic.refresh! }
|
||||
periods = events.map { |e| e[:params].first[:period] }
|
||||
|
||||
expect(periods).to match_array(%i[daily weekly monthly quarterly yearly all])
|
||||
end
|
||||
end
|
||||
end
|
||||
|
Reference in New Issue
Block a user