diff options
author | Felipe Artur <felipefac@gmail.com> | 2019-02-19 11:35:29 -0300 |
---|---|---|
committer | Felipe Artur <felipefac@gmail.com> | 2019-02-19 11:35:29 -0300 |
commit | 648b87315d12d18c92ea14b14ae827480ab3093a (patch) | |
tree | 8c6bab95481bec1c65f0af2fece58b000c3396b7 /spec/models/concerns | |
parent | 52155d8cf8374e9184c2ae834cab761b7520db93 (diff) | |
parent | 0aa64cf80ccd7fda10641af0cd43c4c0a7f3e133 (diff) | |
download | gitlab-ce-648b87315d12d18c92ea14b14ae827480ab3093a.tar.gz |
Merge branch 'master' into issue_51789_part_1
Diffstat (limited to 'spec/models/concerns')
-rw-r--r-- | spec/models/concerns/reactive_caching_spec.rb | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/spec/models/concerns/reactive_caching_spec.rb b/spec/models/concerns/reactive_caching_spec.rb index 97a4c212f1c..03ae45e6b17 100644 --- a/spec/models/concerns/reactive_caching_spec.rb +++ b/spec/models/concerns/reactive_caching_spec.rb @@ -25,7 +25,7 @@ describe ReactiveCaching, :use_clean_rails_memory_store_caching do def result with_reactive_cache do |data| - data / 2 + data end end end @@ -64,7 +64,7 @@ describe ReactiveCaching, :use_clean_rails_memory_store_caching do stub_reactive_cache(instance, 4) end - it { is_expected.to eq(2) } + it { is_expected.to eq(4) } it 'does not enqueue a background worker' do expect(ReactiveCachingWorker).not_to receive(:perform_async) @@ -94,6 +94,14 @@ describe ReactiveCaching, :use_clean_rails_memory_store_caching do end end end + + context 'when cache contains non-nil but blank value' do + before do + stub_reactive_cache(instance, false) + end + + it { is_expected.to eq(false) } + end end describe '#clear_reactive_cache!' do |