diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2022-09-20 02:18:09 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2022-09-20 02:18:09 +0300 |
commit | 6ed4ec3e0b1340f96b7c043ef51d1b33bbe85fde (patch) | |
tree | dc4d20fe6064752c0bd323187252c77e0a89144b /spec/support/shared_examples/graphql/members_shared_examples.rb | |
parent | 9868dae7fc0655bd7ce4a6887d4e6d487690eeed (diff) |
Add latest changes from gitlab-org/gitlab@15-4-stable-eev15.4.0-rc42
Diffstat (limited to 'spec/support/shared_examples/graphql/members_shared_examples.rb')
-rw-r--r-- | spec/support/shared_examples/graphql/members_shared_examples.rb | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/spec/support/shared_examples/graphql/members_shared_examples.rb b/spec/support/shared_examples/graphql/members_shared_examples.rb index 110706c730b..5cba8baa829 100644 --- a/spec/support/shared_examples/graphql/members_shared_examples.rb +++ b/spec/support/shared_examples/graphql/members_shared_examples.rb @@ -40,7 +40,7 @@ RSpec.shared_examples 'querying members with a group' do subject do resolve(described_class, obj: resource, args: base_args.merge(args), - ctx: { current_user: user_4 }, arg_style: :internal) + ctx: { current_user: user_4 }, arg_style: :internal) end describe '#resolve' do @@ -52,6 +52,15 @@ RSpec.shared_examples 'querying members with a group' do expect(subject).to contain_exactly(resource_member, group_1_member, root_group_member) end + context 'with sort options' do + let(:args) { { sort: 'name_asc' } } + + it 'searches users by user name' do + # the order is important here + expect(subject.items).to eq([root_group_member, resource_member, group_1_member]) + end + end + context 'with search' do context 'when the search term matches a user' do let(:args) { { search: 'test' } } @@ -75,7 +84,7 @@ RSpec.shared_examples 'querying members with a group' do subject do resolve(described_class, obj: resource, args: base_args.merge(args), - ctx: { current_user: other_user }, arg_style: :internal) + ctx: { current_user: other_user }, arg_style: :internal) end it 'generates an error' do |