2019-04-29 19:27:42 -05:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
2022-07-27 21:27:38 -05:00
|
|
|
RSpec.describe Jobs::AboutStats do
|
2023-01-09 05:18:21 -06:00
|
|
|
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
|