From 11bda5e7e1637e5b0ace597aafbd45f12b429c32 Mon Sep 17 00:00:00 2001 From: GitLab Bot Date: Thu, 21 Sep 2023 00:10:06 +0000 Subject: Add latest changes from gitlab-org/gitlab@master --- spec/features/gitlab_experiments_spec.rb | 2 +- spec/features/invites_spec.rb | 2 +- spec/features/users/signup_spec.rb | 49 +++++++------------------------- 3 files changed, 13 insertions(+), 40 deletions(-) (limited to 'spec/features') diff --git a/spec/features/gitlab_experiments_spec.rb b/spec/features/gitlab_experiments_spec.rb index c1417f6f7c5..facf4994c44 100644 --- a/spec/features/gitlab_experiments_spec.rb +++ b/spec/features/gitlab_experiments_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -RSpec.describe "Gitlab::Experiment", :js, feature_category: :experimentation_activation do +RSpec.describe "Gitlab::Experiment", :js, feature_category: :activation do # This is part of a set of tests that ensure that tracking remains # consistent at the front end layer. Since we don't want to actually # introduce an experiment in real code, we're going to simulate it diff --git a/spec/features/invites_spec.rb b/spec/features/invites_spec.rb index 0a270adbd01..61f91adee32 100644 --- a/spec/features/invites_spec.rb +++ b/spec/features/invites_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -RSpec.describe 'Group or Project invitations', :aggregate_failures, feature_category: :experimentation_expansion do +RSpec.describe 'Group or Project invitations', :aggregate_failures, feature_category: :acquisition do let_it_be(:owner) { create(:user, name: 'John Doe') } # private will ensure we really have access to the group when we land on the activity page let_it_be(:group) { create(:group, :private, name: 'Owned') } diff --git a/spec/features/users/signup_spec.rb b/spec/features/users/signup_spec.rb index 73e745db6f8..968308938d1 100644 --- a/spec/features/users/signup_spec.rb +++ b/spec/features/users/signup_spec.rb @@ -67,16 +67,6 @@ RSpec.describe 'Signup', :js, feature_category: :user_profile do end shared_examples 'signup process' do - def fill_in_signup_form - fill_in 'new_user_username', with: new_user.username - fill_in 'new_user_email', with: new_user.email - fill_in 'new_user_first_name', with: new_user.first_name - fill_in 'new_user_last_name', with: new_user.last_name - fill_in 'new_user_password', with: new_user.password - - wait_for_all_requests - end - def confirm_email new_user_token = User.find_by_email(new_user.email).confirmation_token @@ -226,9 +216,7 @@ RSpec.describe 'Signup', :js, feature_category: :user_profile 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 - - expect { click_button 'Register' }.to change { User.count }.by(1) + expect { fill_in_sign_up_form(new_user) }.to change { User.count }.by(1) expect(page).to have_current_path users_almost_there_path, ignore_query: true expect(page).to have_content("Please check your email (#{new_user.email}) to confirm your account") @@ -246,9 +234,7 @@ RSpec.describe 'Signup', :js, feature_category: :user_profile do it 'creates the user account and sends a confirmation email' do visit new_user_registration_path - fill_in_signup_form - - expect { click_button 'Register' }.to change { User.count }.by(1) + expect { fill_in_sign_up_form(new_user) }.to change { User.count }.by(1) expect(page).to have_current_path dashboard_projects_path end end @@ -262,8 +248,7 @@ RSpec.describe 'Signup', :js, feature_category: :user_profile do it 'creates the user account and goes to dashboard' do visit new_user_registration_path - fill_in_signup_form - click_button "Register" + fill_in_sign_up_form(new_user) expect(page).to have_current_path dashboard_projects_path end @@ -277,9 +262,7 @@ RSpec.describe 'Signup', :js, feature_category: :user_profile do it 'creates the user but does not sign them in' do visit new_user_registration_path - fill_in_signup_form - - expect { click_button 'Register' }.to change { User.count }.by(1) + expect { fill_in_sign_up_form(new_user) }.to change { User.count }.by(1) expect(page).to have_current_path new_user_session_path, ignore_query: true expect(page).to have_content(<<~TEXT.squish) You have signed up successfully. However, we could not sign you in @@ -294,8 +277,7 @@ RSpec.describe 'Signup', :js, feature_category: :user_profile do create(:user, email: new_user.email) visit new_user_registration_path - fill_in_signup_form - click_button "Register" + fill_in_sign_up_form(new_user) expect(page).to have_current_path user_registration_path, ignore_query: true expect(page).to have_content("error prohibited this user from being saved") @@ -306,8 +288,7 @@ RSpec.describe 'Signup', :js, feature_category: :user_profile do create(:user, email: new_user.email) visit new_user_registration_path - fill_in_signup_form - click_button "Register" + fill_in_sign_up_form(new_user) expect(page).to have_current_path user_registration_path, ignore_query: true expect(page.body).not_to match(/#{new_user.password}/) @@ -328,8 +309,7 @@ RSpec.describe 'Signup', :js, feature_category: :user_profile do visit new_user_registration_path expect(page).to have_content(terms_text) - fill_in_signup_form - click_button 'Register' + fill_in_sign_up_form(new_user) expect(page).to have_current_path(dashboard_projects_path) end @@ -357,9 +337,7 @@ RSpec.describe 'Signup', :js, feature_category: :user_profile do it 'prevents from signing up' do visit new_user_registration_path - fill_in_signup_form - - expect { click_button 'Register' }.not_to change { User.count } + expect { fill_in_sign_up_form(new_user) }.not_to change { User.count } expect(page).to have_content(_('There was an error with the reCAPTCHA. Please solve the reCAPTCHA again.')) expect(page).to have_content( "Minimum length is #{Gitlab::CurrentSettings.minimum_password_length} characters") @@ -370,9 +348,7 @@ RSpec.describe 'Signup', :js, feature_category: :user_profile do it 'prevents from signing up' do visit new_user_registration_path - fill_in_signup_form - - expect { click_button 'Register' }.not_to change { User.count } + expect { fill_in_sign_up_form(new_user) }.not_to change { User.count } expect(page).to have_content('That was a bit too quick! Please resubmit.') end end @@ -381,9 +357,7 @@ RSpec.describe 'Signup', :js, feature_category: :user_profile do it 'allows visiting of a page after initial registration' do visit new_user_registration_path - fill_in_signup_form - - click_button 'Register' + fill_in_sign_up_form(new_user) visit new_project_path @@ -394,8 +368,7 @@ RSpec.describe 'Signup', :js, feature_category: :user_profile do create(:user, email: new_user.email) visit new_user_registration_path - fill_in_signup_form - click_button "Register" + fill_in_sign_up_form(new_user) expect(page).to have_current_path user_registration_path, ignore_query: true expect(page.body).not_to match(/#{new_user.password}/) -- cgit v1.2.3