summaryrefslogtreecommitdiff
path: root/spec/graphql
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2019-11-13 12:06:22 +0000
committerGitLab Bot <gitlab-bot@gitlab.com>2019-11-13 12:06:22 +0000
commit4e516dbff9767a35677fdc4a6e39005b4b564376 (patch)
tree7c650b30777b8e7f72cafb186e9446a50d3fa3be /spec/graphql
parent4f01ac5ba0bf72427ed4fef9b229d056dbb60e89 (diff)
downloadgitlab-ce-4e516dbff9767a35677fdc4a6e39005b4b564376.tar.gz
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/graphql')
-rw-r--r--spec/graphql/types/base_enum_spec.rb24
1 files changed, 24 insertions, 0 deletions
diff --git a/spec/graphql/types/base_enum_spec.rb b/spec/graphql/types/base_enum_spec.rb
new file mode 100644
index 00000000000..3eadb492cf5
--- /dev/null
+++ b/spec/graphql/types/base_enum_spec.rb
@@ -0,0 +1,24 @@
+# frozen_string_literal: true
+
+require 'spec_helper'
+
+describe Types::BaseEnum do
+ describe '#enum' do
+ let(:enum) do
+ Class.new(described_class) do
+ value 'TEST', value: 3
+ value 'other'
+ value 'NORMAL'
+ end
+ end
+
+ it 'adds all enum values to #enum' do
+ expect(enum.enum.keys).to contain_exactly('test', 'other', 'normal')
+ expect(enum.enum.values).to contain_exactly(3, 'other', 'NORMAL')
+ end
+
+ it 'is a HashWithIndefferentAccess' do
+ expect(enum.enum).to be_a(HashWithIndifferentAccess)
+ end
+ end
+end