diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-06-18 11:18:50 +0000 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-06-18 11:18:50 +0000 |
commit | 8c7f4e9d5f36cff46365a7f8c4b9c21578c1e781 (patch) | |
tree | a77e7fe7a93de11213032ed4ab1f33a3db51b738 /spec/models/group_spec.rb | |
parent | 00b35af3db1abfe813a778f643dad221aad51fca (diff) | |
download | gitlab-ce-8c7f4e9d5f36cff46365a7f8c4b9c21578c1e781.tar.gz |
Add latest changes from gitlab-org/gitlab@13-1-stable-ee
Diffstat (limited to 'spec/models/group_spec.rb')
-rw-r--r-- | spec/models/group_spec.rb | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/spec/models/group_spec.rb b/spec/models/group_spec.rb index d6e76258491..93cb6d83489 100644 --- a/spec/models/group_spec.rb +++ b/spec/models/group_spec.rb @@ -662,6 +662,19 @@ describe Group do expect(group.members_with_parents).to include(developer) expect(group.members_with_parents).to include(maintainer) end + + context 'group sharing' do + let!(:shared_group) { create(:group) } + + before do + create(:group_group_link, shared_group: shared_group, shared_with_group: group) + end + + it 'returns shared with group members' do + expect(shared_group.members_with_parents).to( + include(developer)) + end + end end describe '#members_from_self_and_ancestors_with_effective_access_level' do @@ -800,6 +813,22 @@ describe Group do expect(group.user_ids_for_project_authorizations) .to include(maintainer.id, developer.id) end + + context 'group sharing' do + let_it_be(:group) { create(:group) } + let_it_be(:group_user) { create(:user) } + let_it_be(:shared_group) { create(:group) } + + before do + group.add_developer(group_user) + create(:group_group_link, shared_group: shared_group, shared_with_group: group) + end + + it 'returns the user IDs for shared with group members' do + expect(shared_group.user_ids_for_project_authorizations).to( + include(group_user.id)) + end + end end describe '#update_two_factor_requirement' do |