Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'spec/rubocop/cop/graphql/descriptions_spec.rb')
-rw-r--r--spec/rubocop/cop/graphql/descriptions_spec.rb16
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