diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2021-05-19 15:44:42 +0000 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2021-05-19 15:44:42 +0000 |
commit | 4555e1b21c365ed8303ffb7a3325d773c9b8bf31 (patch) | |
tree | 5423a1c7516cffe36384133ade12572cf709398d /spec/features/users | |
parent | e570267f2f6b326480d284e0164a6464ba4081bc (diff) | |
download | gitlab-ce-4555e1b21c365ed8303ffb7a3325d773c9b8bf31.tar.gz |
Add latest changes from gitlab-org/gitlab@13-12-stable-eev13.12.0-rc42
Diffstat (limited to 'spec/features/users')
-rw-r--r-- | spec/features/users/add_email_to_existing_account_spec.rb | 18 | ||||
-rw-r--r-- | spec/features/users/signup_spec.rb | 12 | ||||
-rw-r--r-- | spec/features/users/user_browses_projects_on_user_page_spec.rb | 2 |
3 files changed, 27 insertions, 5 deletions
diff --git a/spec/features/users/add_email_to_existing_account_spec.rb b/spec/features/users/add_email_to_existing_account_spec.rb index 9130b96b0e3..cf78fc4587f 100644 --- a/spec/features/users/add_email_to_existing_account_spec.rb +++ b/spec/features/users/add_email_to_existing_account_spec.rb @@ -4,13 +4,25 @@ require 'spec_helper' RSpec.describe 'AdditionalEmailToExistingAccount' do describe 'add secondary email associated with account' do - let(:user) { create(:user) } + let_it_be(:user) { create(:user) } + let_it_be(:email) { create(:email, user: user) } - it 'verifies confirmation of additional email' do + before do sign_in(user) + end + + it 'verifies confirmation of additional email' do + visit email_confirmation_path(confirmation_token: email.confirmation_token) + + expect(page).to have_content 'Your email address has been successfully confirmed.' + end + + it 'accepts any pending invites for an email confirmation' do + member = create(:group_member, :invited, invite_email: email.email) - email = create(:email, user: user) visit email_confirmation_path(confirmation_token: email.confirmation_token) + + expect(member.reload.user).to eq(user) expect(page).to have_content 'Your email address has been successfully confirmed.' end end diff --git a/spec/features/users/signup_spec.rb b/spec/features/users/signup_spec.rb index 5f70517224e..17a6abb99e0 100644 --- a/spec/features/users/signup_spec.rb +++ b/spec/features/users/signup_spec.rb @@ -57,6 +57,12 @@ RSpec.describe 'Signup' do fill_in 'new_user_password', with: new_user.password end + def confirm_email + new_user_token = User.find_by_email(new_user.email).confirmation_token + + visit user_confirmation_path(confirmation_token: new_user_token) + end + describe 'username validation', :js do before do visit new_user_registration_path @@ -191,7 +197,7 @@ RSpec.describe 'Signup' do stub_feature_flags(soft_email_confirmation: false) end - it 'creates the user account and sends a confirmation email' do + it 'creates the user account and sends a confirmation email, and pre-fills email address after confirming' do visit new_user_registration_path fill_in_signup_form @@ -199,6 +205,10 @@ RSpec.describe 'Signup' do expect { click_button 'Register' }.to change { User.count }.by(1) expect(current_path).to eq users_almost_there_path expect(page).to have_content('Please check your email to confirm your account') + + confirm_email + + expect(find_field('Username or email').value).to eq(new_user.email) end end diff --git a/spec/features/users/user_browses_projects_on_user_page_spec.rb b/spec/features/users/user_browses_projects_on_user_page_spec.rb index 7d05b2ae27a..ded90be3924 100644 --- a/spec/features/users/user_browses_projects_on_user_page_spec.rb +++ b/spec/features/users/user_browses_projects_on_user_page_spec.rb @@ -125,7 +125,7 @@ RSpec.describe 'Users > User browses projects on user page', :js do end before do - Issues::CreateService.new(contributed_project, user, { title: 'Bug in old browser' }).execute + Issues::CreateService.new(project: contributed_project, current_user: user, params: { title: 'Bug in old browser' }).execute event = create(:push_event, project: contributed_project, author: user) create(:push_event_payload, event: event, commit_count: 3) end |