summaryrefslogtreecommitdiff
path: root/spec
diff options
context:
space:
mode:
authorAsh McKenzie <amckenzie@gitlab.com>2019-06-20 12:00:51 +0000
committerAsh McKenzie <amckenzie@gitlab.com>2019-06-20 12:00:51 +0000
commit788690304a495aa6c4d3e2fa163753f28fbdb82f (patch)
tree79e7459147427f165c0bb901d9d843017e6ece72 /spec
parentc79a9f40c6029a8cea39c04d4e6f7f9ff33f522d (diff)
parent03220c00d9cf3bc4ab05ef1ea16948ce47df3834 (diff)
downloadgitlab-ce-788690304a495aa6c4d3e2fa163753f28fbdb82f.tar.gz
Merge branch '63510-error-parsing-true-boolean-in-gitlab-jsoncache' into 'master'
Gitlab::JsonCache#parse_value ensure string Closes #63510 See merge request gitlab-org/gitlab-ce!29885
Diffstat (limited to 'spec')
-rw-r--r--spec/lib/gitlab/json_cache_spec.rb10
1 files changed, 10 insertions, 0 deletions
diff --git a/spec/lib/gitlab/json_cache_spec.rb b/spec/lib/gitlab/json_cache_spec.rb
index b82c09af306..c6a6042c65c 100644
--- a/spec/lib/gitlab/json_cache_spec.rb
+++ b/spec/lib/gitlab/json_cache_spec.rb
@@ -106,6 +106,16 @@ describe Gitlab::JsonCache do
expect(cache.read(key)).to be_nil
end
+ context 'when the cached value is a boolean' do
+ it 'parses the cached value' do
+ allow(backend).to receive(:read)
+ .with(expanded_key)
+ .and_return(true)
+
+ expect(cache.read(key, BroadcastMessage)).to eq(true)
+ end
+ end
+
context 'when the cached value is a hash' do
it 'parses the cached value' do
allow(backend).to receive(:read)