diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2021-09-20 16:18:24 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2021-09-20 16:18:24 +0300 |
commit | 0653e08efd039a5905f3fa4f6e9cef9f5d2f799c (patch) | |
tree | 4dcc884cf6d81db44adae4aa99f8ec1233a41f55 /spec/features/invites_spec.rb | |
parent | 744144d28e3e7fddc117924fef88de5d9674fe4c (diff) |
Add latest changes from gitlab-org/gitlab@14-3-stable-eev14.3.0-rc42
Diffstat (limited to 'spec/features/invites_spec.rb')
-rw-r--r-- | spec/features/invites_spec.rb | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/spec/features/invites_spec.rb b/spec/features/invites_spec.rb index d56bedd4852..87fb8955dcc 100644 --- a/spec/features/invites_spec.rb +++ b/spec/features/invites_spec.rb @@ -189,6 +189,16 @@ RSpec.describe 'Group or Project invitations', :aggregate_failures do end context 'email confirmation enabled' do + context 'when user is not valid in sign up form' do + let(:new_user) { build_stubbed(:user, first_name: '', last_name: '') } + + it 'fails sign up and redirects back to sign up', :aggregate_failures do + expect { fill_in_sign_up_form(new_user) }.not_to change { User.count } + expect(page).to have_content('prohibited this user from being saved') + expect(current_path).to eq(user_registration_path) + end + end + context 'with invite email acceptance', :snowplow do it 'tracks the accepted invite' do fill_in_sign_up_form(new_user) @@ -216,6 +226,20 @@ RSpec.describe 'Group or Project invitations', :aggregate_failures do end end + context 'with invite email acceptance for the invite_email_from experiment', :experiment do + let(:extra_params) do + { invite_type: Emails::Members::INITIAL_INVITE, experiment_name: 'invite_email_from' } + end + + it 'tracks the accepted invite' do + expect(experiment(:invite_email_from)).to track(:accepted) + .with_context(actor: group_invite) + .on_next_instance + + fill_in_sign_up_form(new_user) + end + end + it 'signs up and redirects to the group activity page with all the project/groups invitation automatically accepted' do fill_in_sign_up_form(new_user) fill_in_welcome_form |