diff options
Diffstat (limited to 'spec/lib/gitlab/graphql/authorize')
-rw-r--r-- | spec/lib/gitlab/graphql/authorize/authorize_field_service_spec.rb | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/spec/lib/gitlab/graphql/authorize/authorize_field_service_spec.rb b/spec/lib/gitlab/graphql/authorize/authorize_field_service_spec.rb index 98659dbed57..c1dab5feb91 100644 --- a/spec/lib/gitlab/graphql/authorize/authorize_field_service_spec.rb +++ b/spec/lib/gitlab/graphql/authorize/authorize_field_service_spec.rb @@ -84,6 +84,16 @@ describe Gitlab::Graphql::Authorize::AuthorizeFieldService do end end + context 'when the field is a connection' do + context 'when it resolves to nil' do + let(:field) { type_with_field(Types::QueryType.connection_type, :read_field, nil).fields['testField'].to_graphql } + + it 'does not fail when authorizing' do + expect(resolved).to be_nil + end + end + end + context 'when the field is a specific type' do let(:custom_type) { type(:read_type) } let(:object_in_field) { double('presented in field') } |