diff options
author | Alex Buijs <abuijs@gitlab.com> | 2019-07-31 16:49:52 +0200 |
---|---|---|
committer | Alex Buijs <abuijs@gitlab.com> | 2019-08-08 13:58:20 +0200 |
commit | a0bbfa9fc3da98f9dfa3a626a9dcd9816b88e5ed (patch) | |
tree | b85bacb7e01e69fa7f633adcf8abbd4779913e52 /spec/controllers/registrations_controller_spec.rb | |
parent | 5cbe16c3d2a3a3667021fb8c81f743308aefbdae (diff) | |
download | gitlab-ce-a0bbfa9fc3da98f9dfa3a626a9dcd9816b88e5ed.tar.gz |
Don't redirect to the Almost there page
Don't redirect to the Almost there page after registration
and after resending confirmation instructions
Diffstat (limited to 'spec/controllers/registrations_controller_spec.rb')
-rw-r--r-- | spec/controllers/registrations_controller_spec.rb | 31 |
1 files changed, 27 insertions, 4 deletions
diff --git a/spec/controllers/registrations_controller_spec.rb b/spec/controllers/registrations_controller_spec.rb index faf3c990cb2..aa3622a1194 100644 --- a/spec/controllers/registrations_controller_spec.rb +++ b/spec/controllers/registrations_controller_spec.rb @@ -26,13 +26,36 @@ describe RegistrationsController do end context 'when send_user_confirmation_email is true' do - it 'does not authenticate user and sends confirmation email' do + before do stub_application_setting(send_user_confirmation_email: true) + end + + context 'when soft email confirmation is not enabled' do + before do + stub_feature_flags(soft_email_confirmation: false) + allow(User).to receive(:allow_unconfirmed_access_for).and_return 0 + end + + it 'does not authenticate the user and sends a confirmation email' do + post(:create, params: user_params) + + expect(ActionMailer::Base.deliveries.last.to.first).to eq(user_params[:user][:email]) + expect(subject.current_user).to be_nil + end + end + + context 'when soft email confirmation is enabled' do + before do + stub_feature_flags(soft_email_confirmation: true) + allow(User).to receive(:allow_unconfirmed_access_for).and_return 2.days + end - post(:create, params: user_params) + it 'authenticates the user and sends a confirmation email' do + post(:create, params: user_params) - expect(ActionMailer::Base.deliveries.last.to.first).to eq(user_params[:user][:email]) - expect(subject.current_user).to be_nil + expect(ActionMailer::Base.deliveries.last.to.first).to eq(user_params[:user][:email]) + expect(response).to redirect_to(dashboard_projects_path) + end end end |