Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'spec/lib/gitlab/json_cache_spec.rb')
-rw-r--r--spec/lib/gitlab/json_cache_spec.rb6
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)