From 63b0c730af29fb333a467f50232fc9cd96c39625 Mon Sep 17 00:00:00 2001 From: Tiger Date: Fri, 7 Jun 2019 17:17:33 +1000 Subject: Add a default reactive cache key Aligns with the other reactive cache options by providing a default that can be overridden if necessary. --- spec/models/concerns/reactive_caching_spec.rb | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'spec/models/concerns/reactive_caching_spec.rb') diff --git a/spec/models/concerns/reactive_caching_spec.rb b/spec/models/concerns/reactive_caching_spec.rb index 53df9e0bc05..7faa196623f 100644 --- a/spec/models/concerns/reactive_caching_spec.rb +++ b/spec/models/concerns/reactive_caching_spec.rb @@ -232,4 +232,17 @@ describe ReactiveCaching, :use_clean_rails_memory_store_caching do end end end + + describe 'default options' do + let(:cached_class) { Class.new { include ReactiveCaching } } + + subject { cached_class.new } + + it { expect(subject.reactive_cache_lease_timeout).to be_a(ActiveSupport::Duration) } + it { expect(subject.reactive_cache_refresh_interval).to be_a(ActiveSupport::Duration) } + it { expect(subject.reactive_cache_lifetime).to be_a(ActiveSupport::Duration) } + + it { expect(subject.reactive_cache_key).to respond_to(:call) } + it { expect(subject.reactive_cache_worker_finder).to respond_to(:call) } + end end -- cgit v1.2.1