summaryrefslogtreecommitdiff
path: root/spec/services
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2020-12-10 14:52:44 +0000
committerGitLab Bot <gitlab-bot@gitlab.com>2020-12-10 14:52:44 +0000
commit86a8eee1b8bd43a1fe962905eb97a1f478cc050b (patch)
tree439816bbaf4a0caf16d579223eb9465e0b0daebc /spec/services
parent1b517a5a19c4aafc6fa6d738b0ee7c1e4a2cce36 (diff)
downloadgitlab-ce-86a8eee1b8bd43a1fe962905eb97a1f478cc050b.tar.gz
Add latest changes from gitlab-org/gitlab@13-6-stable-ee
Diffstat (limited to 'spec/services')
-rw-r--r--spec/services/members/invite_service_spec.rb11
1 files changed, 11 insertions, 0 deletions
diff --git a/spec/services/members/invite_service_spec.rb b/spec/services/members/invite_service_spec.rb
index 12a1a54696b..08cdf0d3ae1 100644
--- a/spec/services/members/invite_service_spec.rb
+++ b/spec/services/members/invite_service_spec.rb
@@ -63,4 +63,15 @@ RSpec.describe Members::InviteService do
expect(result[:status]).to eq(:error)
expect(result[:message][invited_member.invite_email]).to eq("Member already invited to #{project.name}")
end
+
+ it 'does not add a member with an access_request' do
+ requested_member = create(:project_member, :access_request, project: project)
+
+ params = { email: requested_member.user.email,
+ access_level: Gitlab::Access::GUEST }
+ result = described_class.new(user, params).execute(project)
+
+ expect(result[:status]).to eq(:error)
+ expect(result[:message][requested_member.user.email]).to eq("Member cannot be invited because they already requested to join #{project.name}")
+ end
end