diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2022-08-18 11:17:02 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2022-08-18 11:17:02 +0300 |
commit | b39512ed755239198a9c294b6a45e65c05900235 (patch) | |
tree | d234a3efade1de67c46b9e5a38ce813627726aa7 /spec/requests/api/graphql/current_user | |
parent | d31474cf3b17ece37939d20082b07f6657cc79a9 (diff) |
Add latest changes from gitlab-org/gitlab@15-3-stable-eev15.3.0-rc42
Diffstat (limited to 'spec/requests/api/graphql/current_user')
-rw-r--r-- | spec/requests/api/graphql/current_user/groups_query_spec.rb | 19 |
1 files changed, 16 insertions, 3 deletions
diff --git a/spec/requests/api/graphql/current_user/groups_query_spec.rb b/spec/requests/api/graphql/current_user/groups_query_spec.rb index ef0f32bacf0..6e36beb2afc 100644 --- a/spec/requests/api/graphql/current_user/groups_query_spec.rb +++ b/spec/requests/api/graphql/current_user/groups_query_spec.rb @@ -6,10 +6,11 @@ RSpec.describe 'Query current user groups' do include GraphqlHelpers let_it_be(:user) { create(:user) } + let_it_be(:root_group) { create(:group, name: 'Root group', path: 'root-group') } let_it_be(:guest_group) { create(:group, name: 'public guest', path: 'public-guest') } - let_it_be(:private_maintainer_group) { create(:group, :private, name: 'b private maintainer', path: 'b-private-maintainer') } + let_it_be(:private_maintainer_group) { create(:group, :private, name: 'b private maintainer', path: 'b-private-maintainer', parent: root_group) } let_it_be(:public_developer_group) { create(:group, project_creation_level: nil, name: 'c public developer', path: 'c-public-developer') } - let_it_be(:public_maintainer_group) { create(:group, name: 'a public maintainer', path: 'a-public-maintainer') } + let_it_be(:public_maintainer_group) { create(:group, name: 'a public maintainer', path: 'a-public-maintainer', parent: root_group) } let_it_be(:public_owner_group) { create(:group, name: 'a public owner', path: 'a-public-owner') } let(:group_arguments) { {} } @@ -77,7 +78,7 @@ RSpec.describe 'Query current user groups' do end context 'when search is provided' do - let(:group_arguments) { { permission_scope: :CREATE_PROJECTS, search: 'maintainer' } } + let(:group_arguments) { { permission_scope: :CREATE_PROJECTS, search: 'root-group maintainer' } } specify do is_expected.to match( @@ -127,6 +128,18 @@ RSpec.describe 'Query current user groups' do ) ) end + + context 'when searching for a full path (including parent)' do + let(:group_arguments) { { search: 'root-group/b-private-maintainer' } } + + specify do + is_expected.to match( + expected_group_hash( + private_maintainer_group + ) + ) + end + end end def expected_group_hash(*groups) |