mirror of
https://github.com/discourse/discourse.git
synced 2024-12-16 06:48:14 +08:00
11 lines
343 B
Ruby
11 lines
343 B
Ruby
require 'rails_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
|