summaryrefslogtreecommitdiff
path: root/spec/support/helpers/reactive_caching_helpers.rb
diff options
context:
space:
mode:
authorReuben Pereira <rpereira@gitlab.com>2019-02-18 11:24:00 +0000
committerNick Thomas <nick@gitlab.com>2019-02-18 11:24:00 +0000
commit0e7a9e46d25813670bc9d37b59d577bda4aeb3f7 (patch)
tree717a8527bd25b8a57e1e35bac89052e88d344622 /spec/support/helpers/reactive_caching_helpers.rb
parent1d229689588e0e22b5cee57f6c8d2ddcc7f0822b (diff)
downloadgitlab-ce-0e7a9e46d25813670bc9d37b59d577bda4aeb3f7.tar.gz
Allow blank values to be stored in reactive cache
Reactive caching concern was using .present? to determine if it got a valid value from the cache. This returns false for values such as false, [], {}. Change this check to !.nil? instead.
Diffstat (limited to 'spec/support/helpers/reactive_caching_helpers.rb')
-rw-r--r--spec/support/helpers/reactive_caching_helpers.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/spec/support/helpers/reactive_caching_helpers.rb b/spec/support/helpers/reactive_caching_helpers.rb
index a575aa99b79..b76b53db0b9 100644
--- a/spec/support/helpers/reactive_caching_helpers.rb
+++ b/spec/support/helpers/reactive_caching_helpers.rb
@@ -10,7 +10,7 @@ module ReactiveCachingHelpers
def stub_reactive_cache(subject = nil, data = nil, *qualifiers)
allow(ReactiveCachingWorker).to receive(:perform_async)
allow(ReactiveCachingWorker).to receive(:perform_in)
- write_reactive_cache(subject, data, *qualifiers) if data
+ write_reactive_cache(subject, data, *qualifiers) unless data.nil?
end
def synchronous_reactive_cache(subject)