diff options
author | Tiger <twatson@gitlab.com> | 2019-06-07 17:17:33 +1000 |
---|---|---|
committer | Tiger <twatson@gitlab.com> | 2019-06-07 17:46:28 +1000 |
commit | 63b0c730af29fb333a467f50232fc9cd96c39625 (patch) | |
tree | 8868d5cf3871fcc9abf78b2b0f2c121dcaac4e07 /spec/models/concerns/reactive_caching_spec.rb | |
parent | 3868a8f0f9f7bb3b8239295d50abe969d407a2a4 (diff) | |
download | gitlab-ce-add-default-reactive-cache-key.tar.gz |
Add a default reactive cache keyadd-default-reactive-cache-key
Aligns with the other reactive cache options by
providing a default that can be overridden if necessary.
Diffstat (limited to 'spec/models/concerns/reactive_caching_spec.rb')
-rw-r--r-- | spec/models/concerns/reactive_caching_spec.rb | 13 |
1 files changed, 13 insertions, 0 deletions
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 |