diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-09-10 21:08:54 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-09-10 21:08:54 +0300 |
commit | c596046be917b250019fdfb509be85cfb48df152 (patch) | |
tree | 2c3716f6f70b42e0683022269a13117704d85d15 /spec/finders | |
parent | 9afe9ca576408a1145b6250d9493032fe65255ae (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/finders')
-rw-r--r-- | spec/finders/group_members_finder_spec.rb | 1 | ||||
-rw-r--r-- | spec/finders/groups_finder_spec.rb | 8 | ||||
-rw-r--r-- | spec/finders/members_finder_spec.rb | 12 |
3 files changed, 21 insertions, 0 deletions
diff --git a/spec/finders/group_members_finder_spec.rb b/spec/finders/group_members_finder_spec.rb index 68b120db227..67e7de5921a 100644 --- a/spec/finders/group_members_finder_spec.rb +++ b/spec/finders/group_members_finder_spec.rb @@ -16,6 +16,7 @@ RSpec.describe GroupMembersFinder, '#execute' do member1 = group.add_maintainer(user1) member2 = group.add_maintainer(user2) member3 = group.add_maintainer(user3) + create(:group_member, :minimal_access, user: create(:user), source: group) result = described_class.new(group).execute diff --git a/spec/finders/groups_finder_spec.rb b/spec/finders/groups_finder_spec.rb index 78764f79a6c..48e4c5dadc9 100644 --- a/spec/finders/groups_finder_spec.rb +++ b/spec/finders/groups_finder_spec.rb @@ -150,6 +150,14 @@ RSpec.describe GroupsFinder do end end end + + context 'being minimal access member of parent group' do + it 'do not return group with minimal_access access' do + create(:group_member, :minimal_access, user: user, source: parent_group) + + is_expected.to contain_exactly(public_subgroup, internal_subgroup) + end + end end end end diff --git a/spec/finders/members_finder_spec.rb b/spec/finders/members_finder_spec.rb index 3ef8d6a01aa..3530858e2de 100644 --- a/spec/finders/members_finder_spec.rb +++ b/spec/finders/members_finder_spec.rb @@ -45,6 +45,18 @@ RSpec.describe MembersFinder, '#execute' do expect(result).to contain_exactly(member1) end + it 'does not return members of parent group with minimal access' do + nested_group.request_access(user1) + member1 = group.add_maintainer(user2) + member2 = nested_group.add_maintainer(user3) + member3 = project.add_maintainer(user4) + create(:group_member, :minimal_access, user: create(:user), source: group) + + result = described_class.new(project, user2).execute + + expect(result).to contain_exactly(member1, member2, member3) + end + it 'includes only non-invite members if user do not have amdin permissions on project' do create(:project_member, :invited, project: project, invite_email: create(:user).email) member1 = project.add_maintainer(user1) |