diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-11-19 11:27:35 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-11-19 11:27:35 +0300 |
commit | 7e9c479f7de77702622631cff2628a9c8dcbc627 (patch) | |
tree | c8f718a08e110ad7e1894510980d2155a6549197 /spec/features/invites_spec.rb | |
parent | e852b0ae16db4052c1c567d9efa4facc81146e88 (diff) |
Add latest changes from gitlab-org/gitlab@13-6-stable-eev13.6.0-rc42
Diffstat (limited to 'spec/features/invites_spec.rb')
-rw-r--r-- | spec/features/invites_spec.rb | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/spec/features/invites_spec.rb b/spec/features/invites_spec.rb index 8ccaf82536a..2ceffa896eb 100644 --- a/spec/features/invites_spec.rb +++ b/spec/features/invites_spec.rb @@ -10,6 +10,7 @@ RSpec.describe 'Group or Project invitations', :aggregate_failures do let(:group_invite) { group.group_members.invite.last } before do + stub_application_setting(require_admin_approval_after_user_signup: false) project.add_maintainer(owner) group.add_owner(owner) group.add_developer('user@example.com', owner) @@ -58,6 +59,8 @@ RSpec.describe 'Group or Project invitations', :aggregate_failures do end it 'pre-fills the Email field on the sign up box with the invite_email from the invite' do + click_link 'Register now' + expect(find_field('Email').value).to eq(group_invite.invite_email) end @@ -92,6 +95,22 @@ RSpec.describe 'Group or Project invitations', :aggregate_failures do before do stub_application_setting(send_user_confirmation_email: send_email_confirmation) visit invite_path(group_invite.raw_invite_token) + click_link 'Register now' + end + + context 'with admin appoval required enabled' do + before do + stub_application_setting(require_admin_approval_after_user_signup: true) + end + + let(:send_email_confirmation) { true } + + it 'does not sign the user in' do + fill_in_sign_up_form(new_user) + + expect(current_path).to eq(new_user_session_path) + expect(page).to have_content('You have signed up successfully. However, we could not sign you in because your account is awaiting approval from your GitLab administrator') + end end context 'email confirmation disabled' do |