diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-05-20 14:34:42 +0000 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-05-20 14:34:42 +0000 |
commit | 9f46488805e86b1bc341ea1620b866016c2ce5ed (patch) | |
tree | f9748c7e287041e37d6da49e0a29c9511dc34768 /spec/support/helpers/reactive_caching_helpers.rb | |
parent | dfc92d081ea0332d69c8aca2f0e745cb48ae5e6d (diff) | |
download | gitlab-ce-9f46488805e86b1bc341ea1620b866016c2ce5ed.tar.gz |
Add latest changes from gitlab-org/gitlab@13-0-stable-ee
Diffstat (limited to 'spec/support/helpers/reactive_caching_helpers.rb')
-rw-r--r-- | spec/support/helpers/reactive_caching_helpers.rb | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/spec/support/helpers/reactive_caching_helpers.rb b/spec/support/helpers/reactive_caching_helpers.rb index aa9d3b3a199..0b0b0622696 100644 --- a/spec/support/helpers/reactive_caching_helpers.rb +++ b/spec/support/helpers/reactive_caching_helpers.rb @@ -10,8 +10,11 @@ module ReactiveCachingHelpers end def stub_reactive_cache(subject = nil, data = nil, *qualifiers) - allow(ReactiveCachingWorker).to receive(:perform_async) - allow(ReactiveCachingWorker).to receive(:perform_in) + ReactiveCaching::WORK_TYPE.values.each do |worker| + allow(worker).to receive(:perform_async) + allow(worker).to receive(:perform_in) + end + write_reactive_cache(subject, data, *qualifiers) unless subject.nil? end @@ -42,8 +45,8 @@ module ReactiveCachingHelpers Rails.cache.write(alive_reactive_cache_key(subject, *qualifiers), true) end - def expect_reactive_cache_update_queued(subject) - expect(ReactiveCachingWorker) + def expect_reactive_cache_update_queued(subject, worker_klass: ReactiveCachingWorker) + expect(worker_klass) .to receive(:perform_in) .with(subject.class.reactive_cache_refresh_interval, subject.class, subject.id) end |