discourse/spec/jobs/dashboard_stats_spec.rb

11 lines
342 B
Ruby
Raw Normal View History

2015-07-07 12:52:19 +08:00
require 'spec_helper'
describe Jobs::DashboardStats do
it 'caches the stats' do
json = { "visited" => 10 }
AdminDashboardData.any_instance.expects(:as_json).returns(json)
$redis.expects(:setex).with(AdminDashboardData.stats_cache_key, 35.minutes, json.to_json)
expect(described_class.new.execute({})).to eq(json)
end
end