mirror of
https://github.com/discourse/discourse.git
synced 2024-12-27 06:31:32 +08:00
473a64d39d
hotness. Note: People on Heroku will have to update their jobs to the new structure in Heroku.md
37 lines
730 B
Ruby
37 lines
730 B
Ruby
require 'spec_helper'
|
|
require 'jobs/periodical_updates'
|
|
|
|
describe Jobs::PeriodicalUpdates do
|
|
|
|
after do
|
|
Jobs::PeriodicalUpdates.new.execute(nil)
|
|
end
|
|
|
|
it "calculates avg post time" do
|
|
Post.expects(:calculate_avg_time).once
|
|
end
|
|
|
|
it "calculates avg topic time" do
|
|
Topic.expects(:calculate_avg_time).once
|
|
end
|
|
|
|
it "features topics" do
|
|
CategoryFeaturedTopic.expects(:feature_topics).once
|
|
end
|
|
|
|
it "updates view counts" do
|
|
User.expects(:update_view_counts).once
|
|
end
|
|
|
|
it "calculates scores" do
|
|
calculator = mock()
|
|
ScoreCalculator.expects(:new).once.returns(calculator)
|
|
calculator.expects(:calculate)
|
|
end
|
|
|
|
it "refreshes hot topics" do
|
|
HotTopic.expects(:refresh!).once
|
|
end
|
|
|
|
end
|