Открыть боковую панель
nt_test111
nt_project_uqmrndnvb9go
Коммиты
03220c00
Не подтверждена
Коммит
03220c00
создал
Июн 20, 2019
по автору
Ash McKenzie
Просмотр файлов
Gitlab::JsonCache#parse_value ensure string
владелец
adeccba1
Изменения
2
Скрыть пробелы
Построчно
Рядом
lib/gitlab/json_cache.rb
Просмотр файла @
03220c00
...
...
@@ -58,7 +58,7 @@ def fetch(key, options = {}, &block)
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
Просмотр файла @
03220c00
...
...
@@ -106,6 +106,16 @@
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
)
...
...
Редактирование
Предварительный просмотр
Поддерживает Markdown
0%
Попробовать снова
или
прикрепить новый файл
.
Отмена
You are about to add
0
people
to the discussion. Proceed with caution.
Сначала завершите редактирование этого сообщения!
Отмена
Пожалуйста,
зарегистрируйтесь
или
войдите
чтобы прокомментировать