diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-03-31 15:08:09 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-03-31 15:08:09 +0300 |
commit | 0d0cddc9ce20c5a7d8a2723d0aa620ca184a711a (patch) | |
tree | 64f91b4d4ca74aa09d2a62ac5910820d087ed7cb /spec/models/member_spec.rb | |
parent | 6044caed20964a70c1ac6c5a3365d567ed96dfde (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/models/member_spec.rb')
-rw-r--r-- | spec/models/member_spec.rb | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/spec/models/member_spec.rb b/spec/models/member_spec.rb index 13a0426624b..0e8ae320405 100644 --- a/spec/models/member_spec.rb +++ b/spec/models/member_spec.rb @@ -342,6 +342,17 @@ describe Member do expect(source.members.invite.pluck(:invite_email)).to include('user@example.com') end end + + context 'when called with an unknown user email starting with a number' do + it 'creates an invited member', :aggregate_failures do + email_starting_with_number = "#{user.id}_email@example.com" + + described_class.add_user(source, email_starting_with_number, :maintainer) + + expect(source.members.invite.pluck(:invite_email)).to include(email_starting_with_number) + expect(source.users.reload).not_to include(user) + end + end end context 'when current_user can update member' do |