diff options
author | Brett Walker <bwalker@gitlab.com> | 2019-05-31 11:46:16 -0500 |
---|---|---|
committer | Brett Walker <bwalker@gitlab.com> | 2019-05-31 13:19:29 -0500 |
commit | 1285b0051705519488fbc7ac3bf8511864560ac9 (patch) | |
tree | 81453b674e1d3719d477573e6a13e98e0a2a4b5e /spec/graphql/types | |
parent | b9798c157ac5973e9dd2b7ad95267014034a219f (diff) | |
download | gitlab-ce-1285b0051705519488fbc7ac3bf8511864560ac9.tar.gz |
Added common fields to the IssueType10795-add-epic-tree-BE-epic-graphql-support
and allow passing of child_complexity to the
'resolver_complexity' metho
Diffstat (limited to 'spec/graphql/types')
-rw-r--r-- | spec/graphql/types/base_field_spec.rb | 2 | ||||
-rw-r--r-- | spec/graphql/types/issue_type_spec.rb | 6 |
2 files changed, 7 insertions, 1 deletions
diff --git a/spec/graphql/types/base_field_spec.rb b/spec/graphql/types/base_field_spec.rb index 4fe426e2447..a7fb156d9a8 100644 --- a/spec/graphql/types/base_field_spec.rb +++ b/spec/graphql/types/base_field_spec.rb @@ -6,7 +6,7 @@ describe Types::BaseField do context 'when considering complexity' do let(:resolver) do Class.new(described_class) do - def self.resolver_complexity(args) + def self.resolver_complexity(args, child_complexity:) 2 if args[:foo] end diff --git a/spec/graphql/types/issue_type_spec.rb b/spec/graphql/types/issue_type_spec.rb index dc37b15001f..bae560829cc 100644 --- a/spec/graphql/types/issue_type_spec.rb +++ b/spec/graphql/types/issue_type_spec.rb @@ -6,4 +6,10 @@ describe GitlabSchema.types['Issue'] do it { expect(described_class.graphql_name).to eq('Issue') } it { expect(described_class).to require_graphql_authorizations(:read_issue) } + + it 'has specific fields' do + %i[relative_position web_path web_url reference].each do |field_name| + expect(described_class).to have_graphql_field(field_name) + end + end end |