diff options
Diffstat (limited to 'spec/graphql/resolvers/package_pipelines_resolver_spec.rb')
-rw-r--r-- | spec/graphql/resolvers/package_pipelines_resolver_spec.rb | 24 |
1 files changed, 16 insertions, 8 deletions
diff --git a/spec/graphql/resolvers/package_pipelines_resolver_spec.rb b/spec/graphql/resolvers/package_pipelines_resolver_spec.rb index 892dc641201..c757c876616 100644 --- a/spec/graphql/resolvers/package_pipelines_resolver_spec.rb +++ b/spec/graphql/resolvers/package_pipelines_resolver_spec.rb @@ -25,32 +25,40 @@ RSpec.describe Resolvers::PackagePipelinesResolver do context 'with invalid after' do let(:args) { { first: 1, after: 'not_json_string' } } - it 'raises argument error' do - expect { subject }.to raise_error(Gitlab::Graphql::Errors::ArgumentError) + it 'generates an argument error' do + expect_graphql_error_to_be_created(Gitlab::Graphql::Errors::ArgumentError) do + subject + end end end context 'with invalid after key' do let(:args) { { first: 1, after: encode_cursor(foo: 3) } } - it 'raises argument error' do - expect { subject }.to raise_error(Gitlab::Graphql::Errors::ArgumentError) + it 'generates an argument error' do + expect_graphql_error_to_be_created(Gitlab::Graphql::Errors::ArgumentError) do + subject + end end end context 'with invalid before' do let(:args) { { last: 1, before: 'not_json_string' } } - it 'raises argument error' do - expect { subject }.to raise_error(Gitlab::Graphql::Errors::ArgumentError) + it 'generates an argument error' do + expect_graphql_error_to_be_created(Gitlab::Graphql::Errors::ArgumentError) do + subject + end end end context 'with invalid before key' do let(:args) { { last: 1, before: encode_cursor(foo: 3) } } - it 'raises argument error' do - expect { subject }.to raise_error(Gitlab::Graphql::Errors::ArgumentError) + it 'generates an argument error' do + expect_graphql_error_to_be_created(Gitlab::Graphql::Errors::ArgumentError) do + subject + end end end |