diff options
Diffstat (limited to 'spec/rubocop/cop/graphql/authorize_types_spec.rb')
-rw-r--r-- | spec/rubocop/cop/graphql/authorize_types_spec.rb | 31 |
1 files changed, 30 insertions, 1 deletions
diff --git a/spec/rubocop/cop/graphql/authorize_types_spec.rb b/spec/rubocop/cop/graphql/authorize_types_spec.rb index 9242b865b20..6c521789e34 100644 --- a/spec/rubocop/cop/graphql/authorize_types_spec.rb +++ b/spec/rubocop/cop/graphql/authorize_types_spec.rb @@ -1,7 +1,6 @@ # frozen_string_literal: true require 'fast_spec_helper' -require 'rubocop' require_relative '../../../../rubocop/cop/graphql/authorize_types' @@ -63,4 +62,34 @@ RSpec.describe RuboCop::Cop::Graphql::AuthorizeTypes do end TYPE end + + it 'does not add an offense for subtypes of BaseUnion' do + expect_no_offenses(<<~TYPE) + module Types + class AType < BaseUnion + possible_types Types::Foo, Types::Bar + end + end + TYPE + end + + it 'does not add an offense for subtypes of BaseInputObject' do + expect_no_offenses(<<~TYPE) + module Types + class AType < BaseInputObject + argument :a_thing + end + end + TYPE + end + + it 'does not add an offense for InputTypes' do + expect_no_offenses(<<~TYPE) + module Types + class AInputType < SomeObjectType + argument :a_thing + end + end + TYPE + end end |