discourse/spec/jobs/about_stats_spec.rb

11 lines
315 B
Ruby
Raw Normal View History

2016-04-01 05:33:25 +08:00
require 'rails_helper'
2015-07-07 12:52:19 +08:00
describe Jobs::AboutStats do
it 'caches the stats' do
stats = { "visited" => 10 }
About.any_instance.expects(:stats).returns(stats)
$redis.expects(:setex).with(About.stats_cache_key, 35.minutes, stats.to_json)
expect(described_class.new.execute({})).to eq(stats)
end
end