diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2019-12-11 06:07:31 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2019-12-11 06:07:31 +0300 |
commit | 9caed104bc903734d996161ba13a579f2be49d7c (patch) | |
tree | d7c3e6a534dfa85128f1011c4fb16f7f697d3f80 /spec/lib/gitlab/json_cache_spec.rb | |
parent | a59c9590f5171f3638a1b2abeff55157aedc577b (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/lib/gitlab/json_cache_spec.rb')
-rw-r--r-- | spec/lib/gitlab/json_cache_spec.rb | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/spec/lib/gitlab/json_cache_spec.rb b/spec/lib/gitlab/json_cache_spec.rb index 39cdd42088e..3bb67600ec9 100644 --- a/spec/lib/gitlab/json_cache_spec.rb +++ b/spec/lib/gitlab/json_cache_spec.rb @@ -378,6 +378,12 @@ describe Gitlab::JsonCache do expect(result).to eq(broadcast_message) end + it 'decodes enums correctly' do + result = cache.fetch(key, as: BroadcastMessage) { 'block result' } + + expect(result.broadcast_type).to eq(broadcast_message.broadcast_type) + end + context 'when the cached value is an instance of ActiveRecord::Base' do it 'returns a persisted record when id is set' do backend.write(expanded_key, broadcast_message.to_json) |