2019-04-29 19:27:42 -05:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
2015-10-11 04:41:23 -05:00
|
|
|
require 'rails_helper'
|
2015-07-06 23:52:19 -05:00
|
|
|
|
|
|
|
describe Jobs::AboutStats do
|
|
|
|
it 'caches the stats' do
|
2016-05-17 21:42:40 -05:00
|
|
|
begin
|
|
|
|
stats = About.fetch_stats.to_json
|
|
|
|
cache_key = About.stats_cache_key
|
2019-12-03 03:05:53 -06:00
|
|
|
Discourse.redis.del(cache_key)
|
2016-04-21 01:45:16 -05:00
|
|
|
|
2016-05-17 21:42:40 -05:00
|
|
|
expect(described_class.new.execute({})).to eq(stats)
|
2019-12-03 03:05:53 -06:00
|
|
|
expect(Discourse.redis.get(cache_key)).to eq(stats)
|
2016-05-17 21:42:40 -05:00
|
|
|
ensure
|
2019-12-03 03:05:53 -06:00
|
|
|
Discourse.redis.del(cache_key)
|
2016-05-17 21:42:40 -05:00
|
|
|
end
|
2015-07-06 23:52:19 -05:00
|
|
|
end
|
|
|
|
end
|