Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
03220c00
Commit
03220c00
authored
Jun 20, 2019
by
Ash McKenzie
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Gitlab::JsonCache#parse_value ensure string
parent
adeccba1
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
1 deletion
+11
-1
lib/gitlab/json_cache.rb
lib/gitlab/json_cache.rb
+1
-1
spec/lib/gitlab/json_cache_spec.rb
spec/lib/gitlab/json_cache_spec.rb
+10
-0
No files found.
lib/gitlab/json_cache.rb
View file @
03220c00
...
...
@@ -58,7 +58,7 @@ module Gitlab
private
def
parse_value
(
raw
,
klass
)
value
=
ActiveSupport
::
JSON
.
decode
(
raw
)
value
=
ActiveSupport
::
JSON
.
decode
(
raw
.
to_s
)
case
value
when
Hash
then
parse_entry
(
value
,
klass
)
...
...
spec/lib/gitlab/json_cache_spec.rb
View file @
03220c00
...
...
@@ -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
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment