diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2023-04-18 18:08:42 +0000 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2023-04-18 18:08:42 +0000 |
commit | 9f2bc6fc4c27d0703260352c79463fbc62555ac8 (patch) | |
tree | b65188898a054771df56298e4737837e999c8866 /spec/finders | |
parent | b6b9abb7cdb61f18d6fc5222e52486d7f6c482dc (diff) | |
download | gitlab-ce-9f2bc6fc4c27d0703260352c79463fbc62555ac8.tar.gz |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/finders')
-rw-r--r-- | spec/finders/fork_targets_finder_spec.rb | 25 |
1 files changed, 23 insertions, 2 deletions
diff --git a/spec/finders/fork_targets_finder_spec.rb b/spec/finders/fork_targets_finder_spec.rb index 41651513f18..746c48a8fab 100644 --- a/spec/finders/fork_targets_finder_spec.rb +++ b/spec/finders/fork_targets_finder_spec.rb @@ -29,17 +29,38 @@ RSpec.describe ForkTargetsFinder do create(:group).tap { |g| g.add_guest(user) } end + let_it_be(:shared_group_to_group_with_owner_access) do + create(:group) + end + before do project.namespace.add_owner(user) + create(:group_group_link, :maintainer, + shared_with_group: owned_group, + shared_group: shared_group_to_group_with_owner_access + ) end shared_examples 'returns namespaces and groups' do it 'returns all user manageable namespaces' do - expect(finder.execute).to match_array([user.namespace, maintained_group, owned_group, project.namespace, developer_group]) + expect(finder.execute).to match_array([ + user.namespace, + maintained_group, + owned_group, + project.namespace, + developer_group, + shared_group_to_group_with_owner_access + ]) end it 'returns only groups when only_groups option is passed' do - expect(finder.execute(only_groups: true)).to match_array([maintained_group, owned_group, project.namespace, developer_group]) + expect(finder.execute(only_groups: true)).to match_array([ + maintained_group, + owned_group, + project.namespace, + developer_group, + shared_group_to_group_with_owner_access + ]) end it 'returns groups relation when only_groups option is passed' do |