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/users_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/users_resolver_spec.rb')
-rw-r--r-- | spec/graphql/resolvers/users_resolver_spec.rb | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/spec/graphql/resolvers/users_resolver_spec.rb b/spec/graphql/resolvers/users_resolver_spec.rb index e3d595e0790..1aa24055a89 100644 --- a/spec/graphql/resolvers/users_resolver_spec.rb +++ b/spec/graphql/resolvers/users_resolver_spec.rb @@ -5,8 +5,12 @@ require 'spec_helper' RSpec.describe Resolvers::UsersResolver do include GraphqlHelpers - let_it_be(:user1) { create(:user) } - let_it_be(:user2) { create(:user) } + let_it_be(:user1) { create(:user, name: "SomePerson") } + let_it_be(:user2) { create(:user, username: "someone123784") } + + specify do + expect(described_class).to have_nullable_graphql_type(Types::UserType.connection_type) + end describe '#resolve' do it 'raises an error when read_users_list is not authorized' do @@ -43,6 +47,14 @@ RSpec.describe Resolvers::UsersResolver do ).to contain_exactly(user1, user2) end end + + context 'when a search term is passed' do + it 'returns all users who match', :aggregate_failures do + expect(resolve_users(search: "some")).to contain_exactly(user1, user2) + expect(resolve_users(search: "123784")).to contain_exactly(user2) + expect(resolve_users(search: "someperson")).to contain_exactly(user1) + end + end end def resolve_users(args = {}) |