From 9dc93a4519d9d5d7be48ff274127136236a3adb3 Mon Sep 17 00:00:00 2001 From: GitLab Bot Date: Tue, 20 Apr 2021 23:50:22 +0000 Subject: Add latest changes from gitlab-org/gitlab@13-11-stable-ee --- spec/rubocop/cop/graphql/descriptions_spec.rb | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) (limited to 'spec/rubocop/cop/graphql') 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 -- cgit v1.2.3