summaryrefslogtreecommitdiff
path: root/spec/support/reactive_caching_helpers.rb
diff options
context:
space:
mode:
authorClement Ho <ClemMakesApps@gmail.com>2018-02-07 12:45:37 -0600
committerClement Ho <ClemMakesApps@gmail.com>2018-02-07 12:45:37 -0600
commita0c0ea655a8659bb1388a6ffc6738754c1c0f9bd (patch)
treebdf8ca27712e033802868fc09533381484f641ae /spec/support/reactive_caching_helpers.rb
parent48c78958e31c666fcba0b253104d47be5b3c82b0 (diff)
parent8900b23eab6abd5a6c01278fa0da18d5bed98491 (diff)
downloadgitlab-ce-axios-profile.tar.gz
Merge branch 'master' into axios-profileaxios-profile
Diffstat (limited to 'spec/support/reactive_caching_helpers.rb')
-rw-r--r--spec/support/reactive_caching_helpers.rb6
1 files changed, 6 insertions, 0 deletions
diff --git a/spec/support/reactive_caching_helpers.rb b/spec/support/reactive_caching_helpers.rb
index 34124f02133..e22dd974c6a 100644
--- a/spec/support/reactive_caching_helpers.rb
+++ b/spec/support/reactive_caching_helpers.rb
@@ -13,6 +13,12 @@ module ReactiveCachingHelpers
write_reactive_cache(subject, data, *qualifiers) if data
end
+ def synchronous_reactive_cache(subject)
+ allow(service).to receive(:with_reactive_cache) do |*args, &block|
+ block.call(service.calculate_reactive_cache(*args))
+ end
+ end
+
def read_reactive_cache(subject, *qualifiers)
Rails.cache.read(reactive_cache_key(subject, *qualifiers))
end