diff options
author | Shinya Maeda <shinya@gitlab.com> | 2018-07-25 13:03:18 +0300 |
---|---|---|
committer | Shinya Maeda <shinya@gitlab.com> | 2018-07-25 13:03:18 +0300 |
commit | c807a41849ad83e2a8ad3f206c454a46bff602d2 (patch) | |
tree | 642acf5c4e77516f1c4a33d4d356f69fd56501c8 /spec/models/concerns | |
parent | 6cb30f83255f0982646fea688f2fe275a3b22cc7 (diff) |
Backport reactive caching
Diffstat (limited to 'spec/models/concerns')
-rw-r--r-- | spec/models/concerns/reactive_caching_spec.rb | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/spec/models/concerns/reactive_caching_spec.rb b/spec/models/concerns/reactive_caching_spec.rb index 0f156619e9e..79f75c0ffa0 100644 --- a/spec/models/concerns/reactive_caching_spec.rb +++ b/spec/models/concerns/reactive_caching_spec.rb @@ -125,6 +125,13 @@ describe ReactiveCaching, :use_clean_rails_memory_store_caching do go! end + it "calls a reactive_cache_updated only once if content did not change on subsequent update" do + expect(instance).to receive(:calculate_reactive_cache).twice + expect(instance).to receive(:reactive_cache_updated).once + + 2.times { instance.exclusively_update_reactive_cache! } + end + context 'and #calculate_reactive_cache raises an exception' do before do stub_reactive_cache(instance, "preexisting") |