summaryrefslogtreecommitdiff
path: root/spec/graphql/types/release_type_spec.rb
diff options
context:
space:
mode:
Diffstat (limited to 'spec/graphql/types/release_type_spec.rb')
-rw-r--r--spec/graphql/types/release_type_spec.rb37
1 files changed, 37 insertions, 0 deletions
diff --git a/spec/graphql/types/release_type_spec.rb b/spec/graphql/types/release_type_spec.rb
new file mode 100644
index 00000000000..d22a0b4f0fa
--- /dev/null
+++ b/spec/graphql/types/release_type_spec.rb
@@ -0,0 +1,37 @@
+# frozen_string_literal: true
+
+require 'spec_helper'
+
+describe GitlabSchema.types['Release'] do
+ it { expect(described_class).to require_graphql_authorizations(:read_release) }
+
+ it 'has the expected fields' do
+ expected_fields = %w[
+ tag_name tag_path
+ description description_html
+ name milestones author commit
+ created_at released_at
+ ]
+
+ expect(described_class).to include_graphql_fields(*expected_fields)
+ end
+
+ describe 'milestones field' do
+ subject { described_class.fields['milestones'] }
+
+ it { is_expected.to have_graphql_type(Types::MilestoneType.connection_type) }
+ end
+
+ describe 'author field' do
+ subject { described_class.fields['author'] }
+
+ it { is_expected.to have_graphql_type(Types::UserType) }
+ end
+
+ describe 'commit field' do
+ subject { described_class.fields['commit'] }
+
+ it { is_expected.to have_graphql_type(Types::CommitType) }
+ it { is_expected.to require_graphql_authorizations(:reporter_access) }
+ end
+end