diff options
Diffstat (limited to 'spec/features/users/signup_spec.rb')
-rw-r--r-- | spec/features/users/signup_spec.rb | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/spec/features/users/signup_spec.rb b/spec/features/users/signup_spec.rb index 11ff318c346..d65eea3671c 100644 --- a/spec/features/users/signup_spec.rb +++ b/spec/features/users/signup_spec.rb @@ -10,7 +10,7 @@ RSpec.shared_examples 'Signup name validation' do |field, max_length, label| visit new_user_registration_path end - describe "#{field} validation", :js do + describe "#{field} validation" do it "does not show an error border if the user's fullname length is not longer than #{max_length} characters" do fill_in field, with: 'u' * max_length @@ -44,7 +44,7 @@ RSpec.shared_examples 'Signup name validation' do |field, max_length, label| end end -RSpec.describe 'Signup', feature_category: :user_profile do +RSpec.describe 'Signup', :js, feature_category: :user_profile do include TermsHelper let(:new_user) { build_stubbed(:user) } @@ -71,7 +71,7 @@ RSpec.describe 'Signup', feature_category: :user_profile do stub_application_setting(require_admin_approval_after_user_signup: false) end - describe 'username validation', :js do + describe 'username validation' do before do visit new_user_registration_path end @@ -200,9 +200,8 @@ RSpec.describe 'Signup', feature_category: :user_profile do stub_application_setting_enum('email_confirmation_setting', 'hard') end - context 'when soft email confirmation is not enabled' do + context 'when email confirmation setting is not `soft`' do before do - stub_feature_flags(soft_email_confirmation: false) stub_feature_flags(identity_verification: false) end @@ -221,9 +220,9 @@ RSpec.describe 'Signup', feature_category: :user_profile do end end - context 'when soft email confirmation is enabled' do + context 'when email confirmation setting is `soft`' do before do - stub_feature_flags(soft_email_confirmation: true) + stub_application_setting_enum('email_confirmation_setting', 'soft') end it 'creates the user account and sends a confirmation email' do @@ -338,6 +337,7 @@ RSpec.describe 'Signup', feature_category: :user_profile do expect { click_button 'Register' }.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") end end @@ -357,6 +357,8 @@ RSpec.describe 'Signup', feature_category: :user_profile do visit new_user_registration_path fill_in_signup_form + wait_for_all_requests + click_button 'Register' visit new_project_path @@ -384,7 +386,7 @@ RSpec.describe 'Signup', feature_category: :user_profile do expect(page.body).not_to match(/#{new_user.password}/) end - context 'with invalid email', :saas, :js do + context 'with invalid email' do it_behaves_like 'user email validation' do let(:path) { new_user_registration_path } end |