summaryrefslogtreecommitdiff
path: root/spec/controllers/registrations_controller_spec.rb
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2020-03-12 00:09:34 +0000
committerGitLab Bot <gitlab-bot@gitlab.com>2020-03-12 00:09:34 +0000
commit5781a4966047232d4725f9ee4769c4bd5aed9b26 (patch)
tree0ef2b81a40931ec51f8fdd5284ed9e47cf42a923 /spec/controllers/registrations_controller_spec.rb
parent4d48b3cfcd74bcca0f0f305746f74cf7224dd78b (diff)
downloadgitlab-ce-5781a4966047232d4725f9ee4769c4bd5aed9b26.tar.gz
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/controllers/registrations_controller_spec.rb')
-rw-r--r--spec/controllers/registrations_controller_spec.rb18
1 files changed, 10 insertions, 8 deletions
diff --git a/spec/controllers/registrations_controller_spec.rb b/spec/controllers/registrations_controller_spec.rb
index 8d79e505e5d..d7fe3e87056 100644
--- a/spec/controllers/registrations_controller_spec.rb
+++ b/spec/controllers/registrations_controller_spec.rb
@@ -79,29 +79,31 @@ describe RegistrationsController do
stub_application_setting(send_user_confirmation_email: true)
end
- context 'when a grace period is active for confirming the email address' do
+ context 'when soft email confirmation is not enabled' do
before do
- allow(User).to receive(:allow_unconfirmed_access_for).and_return 2.days
+ stub_feature_flags(soft_email_confirmation: false)
+ allow(User).to receive(:allow_unconfirmed_access_for).and_return 0
end
- it 'sends a confirmation email and redirects to the dashboard' do
+ 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(response).to redirect_to(dashboard_projects_path)
+ expect(subject.current_user).to be_nil
end
end
- context 'when no grace period is active for confirming the email address' do
+ context 'when soft email confirmation is enabled' do
before do
- allow(User).to receive(:allow_unconfirmed_access_for).and_return 0
+ stub_feature_flags(soft_email_confirmation: true)
+ allow(User).to receive(:allow_unconfirmed_access_for).and_return 2.days
end
- it 'sends a confirmation email and redirects to the almost there page' do
+ 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(response).to redirect_to(users_almost_there_path)
+ expect(response).to redirect_to(dashboard_projects_path)
end
end
end