diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-05-20 14:34:42 +0000 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-05-20 14:34:42 +0000 |
commit | 9f46488805e86b1bc341ea1620b866016c2ce5ed (patch) | |
tree | f9748c7e287041e37d6da49e0a29c9511dc34768 /spec/controllers/registrations_controller_spec.rb | |
parent | dfc92d081ea0332d69c8aca2f0e745cb48ae5e6d (diff) | |
download | gitlab-ce-9f46488805e86b1bc341ea1620b866016c2ce5ed.tar.gz |
Add latest changes from gitlab-org/gitlab@13-0-stable-ee
Diffstat (limited to 'spec/controllers/registrations_controller_spec.rb')
-rw-r--r-- | spec/controllers/registrations_controller_spec.rb | 32 |
1 files changed, 15 insertions, 17 deletions
diff --git a/spec/controllers/registrations_controller_spec.rb b/spec/controllers/registrations_controller_spec.rb index 0b4ecb68cf7..01a9647a763 100644 --- a/spec/controllers/registrations_controller_spec.rb +++ b/spec/controllers/registrations_controller_spec.rb @@ -139,21 +139,11 @@ describe RegistrationsController do expect(flash[:alert]).to eq(_('There was an error with the reCAPTCHA. Please solve the reCAPTCHA again.')) end - it 'redirects to the dashboard when the recaptcha is solved' do + it 'redirects to the dashboard when the reCAPTCHA is solved' do post(:create, params: user_params) expect(flash[:notice]).to eq(I18n.t('devise.registrations.signed_up')) end - - it 'does not require reCAPTCHA if disabled by feature flag' do - stub_feature_flags(registrations_recaptcha: false) - - post(:create, params: user_params) - - expect(controller).not_to receive(:verify_recaptcha) - expect(flash[:alert]).to be_nil - expect(flash[:notice]).to eq(I18n.t('devise.registrations.signed_up')) - end end context 'when invisible captcha is enabled' do @@ -294,8 +284,6 @@ describe RegistrationsController do end it "logs a 'User Created' message" do - stub_feature_flags(registrations_recaptcha: false) - expect(Gitlab::AppLogger).to receive(:info).with(/\AUser Created: username=new_username email=new@user.com.+\z/).and_call_original post(:create, params: user_params) @@ -419,24 +407,34 @@ describe RegistrationsController do describe '#welcome' do subject { get :welcome } - before do - sign_in(create(:user)) - end - context 'signup_flow experiment enabled' do before do stub_experiment_for_user(signup_flow: true) end it 'renders the devise_experimental_separate_sign_up_flow layout' do + sign_in(create(:user)) + expected_layout = Gitlab.ee? ? :checkout : :devise_experimental_separate_sign_up_flow expect(subject).to render_template(expected_layout) end + + context '2FA is required from group' do + before do + user = create(:user, require_two_factor_authentication_from_group: true) + sign_in(user) + end + + it 'does not perform a redirect' do + expect(subject).not_to redirect_to(profile_two_factor_auth_path) + end + end end context 'signup_flow experiment disabled' do before do + sign_in(create(:user)) stub_experiment_for_user(signup_flow: false) end |