diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2021-04-21 02:50:22 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2021-04-21 02:50:22 +0300 |
commit | 9dc93a4519d9d5d7be48ff274127136236a3adb3 (patch) | |
tree | 70467ae3692a0e35e5ea56bcb803eb512a10bedb /spec/rubocop/cop/graphql | |
parent | 4b0f34b6d759d6299322b3a54453e930c6121ff0 (diff) |
Add latest changes from gitlab-org/gitlab@13-11-stable-eev13.11.0-rc43
Diffstat (limited to 'spec/rubocop/cop/graphql')
-rw-r--r-- | spec/rubocop/cop/graphql/descriptions_spec.rb | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/spec/rubocop/cop/graphql/descriptions_spec.rb b/spec/rubocop/cop/graphql/descriptions_spec.rb index af660aee165..9709a253bdc 100644 --- a/spec/rubocop/cop/graphql/descriptions_spec.rb +++ b/spec/rubocop/cop/graphql/descriptions_spec.rb @@ -6,7 +6,7 @@ require_relative '../../../../rubocop/cop/graphql/descriptions' RSpec.describe RuboCop::Cop::Graphql::Descriptions do subject(:cop) { described_class.new } - context 'fields' do + context 'with fields' do it 'adds an offense when there is no description' do expect_offense(<<~TYPE) module Types @@ -46,9 +46,19 @@ RSpec.describe RuboCop::Cop::Graphql::Descriptions do end TYPE end + + it 'does not add an offense when there is a resolver' do + expect_no_offenses(<<~TYPE.strip) + module Types + class FakeType < BaseObject + field :a_thing, resolver: ThingResolver + end + end + TYPE + end end - context 'arguments' do + context 'with arguments' do it 'adds an offense when there is no description' do expect_offense(<<~TYPE) module Types @@ -90,7 +100,7 @@ RSpec.describe RuboCop::Cop::Graphql::Descriptions do end end - context 'enum values' do + context 'with enum values' do it 'adds an offense when there is no description' do expect_offense(<<~TYPE) module Types |