Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'spec/support/shared_examples/graphql/members_shared_examples.rb')
-rw-r--r--spec/support/shared_examples/graphql/members_shared_examples.rb13
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