diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-11-19 11:27:35 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-11-19 11:27:35 +0300 |
commit | 7e9c479f7de77702622631cff2628a9c8dcbc627 (patch) | |
tree | c8f718a08e110ad7e1894510980d2155a6549197 /spec/graphql/resolvers/snippets_resolver_spec.rb | |
parent | e852b0ae16db4052c1c567d9efa4facc81146e88 (diff) |
Add latest changes from gitlab-org/gitlab@13-6-stable-eev13.6.0-rc42
Diffstat (limited to 'spec/graphql/resolvers/snippets_resolver_spec.rb')
-rw-r--r-- | spec/graphql/resolvers/snippets_resolver_spec.rb | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/spec/graphql/resolvers/snippets_resolver_spec.rb b/spec/graphql/resolvers/snippets_resolver_spec.rb index 180be8e8624..a58d9c5ac3a 100644 --- a/spec/graphql/resolvers/snippets_resolver_spec.rb +++ b/spec/graphql/resolvers/snippets_resolver_spec.rb @@ -36,7 +36,7 @@ RSpec.describe Resolvers::SnippetsResolver do context 'when using filters' do context 'by author id' do it 'returns the snippets' do - snippets = resolve_snippets(args: { author_id: current_user.to_global_id }) + snippets = resolve_snippets(args: { author_id: global_id_of(current_user) }) expect(snippets).to contain_exactly(personal_snippet, project_snippet) end @@ -44,7 +44,7 @@ RSpec.describe Resolvers::SnippetsResolver do it 'returns an error if the param id is invalid' do expect do resolve_snippets(args: { author_id: 'foo' }) - end.to raise_error(Gitlab::Graphql::Errors::ArgumentError) + end.to raise_error(GraphQL::CoercionError) end end @@ -65,7 +65,7 @@ RSpec.describe Resolvers::SnippetsResolver do it 'returns an error if the param id is invalid' do expect do resolve_snippets(args: { project_id: 'foo' }) - end.to raise_error(Gitlab::Graphql::Errors::ArgumentError) + end.to raise_error(GraphQL::CoercionError) end end @@ -99,14 +99,14 @@ RSpec.describe Resolvers::SnippetsResolver do expect(snippets).to contain_exactly(personal_snippet, project_snippet) end - it 'returns an error if the gid is invalid' do + it 'returns an error if the id cannot be coerced' do args = { ids: [personal_snippet.to_global_id, 'foo'] } expect do resolve_snippets(args: args) - end.to raise_error(Gitlab::Graphql::Errors::ArgumentError) + end.to raise_error(GraphQL::CoercionError, '"foo" is not a valid Global ID') end it 'returns an error if both project and author are provided' do |