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