mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
BUGFIX: no need for mock central here
This commit is contained in:
@@ -3,30 +3,12 @@ require_dependency 'jobs/scheduled/periodical_updates'
|
|||||||
|
|
||||||
describe Jobs::PeriodicalUpdates do
|
describe Jobs::PeriodicalUpdates do
|
||||||
|
|
||||||
after do
|
|
||||||
|
it "works" do
|
||||||
|
|
||||||
|
# does not blow up, no mocks, everything is called
|
||||||
Jobs::PeriodicalUpdates.new.execute(nil)
|
Jobs::PeriodicalUpdates.new.execute(nil)
|
||||||
end
|
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
|
|
||||||
UserStat.expects(:update_view_counts).once
|
|
||||||
end
|
|
||||||
|
|
||||||
it "calculates scores" do
|
|
||||||
calculator = mock()
|
|
||||||
ScoreCalculator.expects(:new).once.returns(calculator)
|
|
||||||
calculator.expects(:calculate)
|
|
||||||
end
|
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|||||||
Reference in New Issue
Block a user