summaryrefslogtreecommitdiff
path: root/spec/controllers/registrations_controller_spec.rb
diff options
context:
space:
mode:
authorLin Jen-Shin <godfat@godfat.org>2019-03-06 20:12:04 +0800
committerLin Jen-Shin <godfat@godfat.org>2019-03-19 13:01:37 +0800
commit6b0d493350ed9288c4a68a35dbbb4a4b91bd9637 (patch)
treeaabb183a119412a23607ee4490652e1d7de2fc4f /spec/controllers/registrations_controller_spec.rb
parent3c5a81cb83e6022530e53b1b6cdedf94c92d980e (diff)
downloadgitlab-ce-6b0d493350ed9288c4a68a35dbbb4a4b91bd9637.tar.gz
Introduce ApplicationSettingImplementation yay
So the fake can enjoy it, too. We don't use `prepend` because that'll require we change `allow_any_instance_of` to `expect_next_instance_of`, but that's not very easy to do. We can do that later.
Diffstat (limited to 'spec/controllers/registrations_controller_spec.rb')
-rw-r--r--spec/controllers/registrations_controller_spec.rb6
1 files changed, 3 insertions, 3 deletions
diff --git a/spec/controllers/registrations_controller_spec.rb b/spec/controllers/registrations_controller_spec.rb
index fd151e8a298..c1baf88778d 100644
--- a/spec/controllers/registrations_controller_spec.rb
+++ b/spec/controllers/registrations_controller_spec.rb
@@ -15,7 +15,7 @@ describe RegistrationsController do
context 'when send_user_confirmation_email is false' do
it 'signs the user in' do
- allow_any_instance_of(ApplicationSetting).to receive(:send_user_confirmation_email).and_return(false)
+ stub_application_setting(send_user_confirmation_email: false)
expect { post(:create, params: user_params) }.not_to change { ActionMailer::Base.deliveries.size }
expect(subject.current_user).not_to be_nil
@@ -24,7 +24,7 @@ describe RegistrationsController do
context 'when send_user_confirmation_email is true' do
it 'does not authenticate user and sends confirmation email' do
- allow_any_instance_of(ApplicationSetting).to receive(:send_user_confirmation_email).and_return(true)
+ stub_application_setting(send_user_confirmation_email: true)
post(:create, params: user_params)
@@ -35,7 +35,7 @@ describe RegistrationsController do
context 'when signup_enabled? is false' do
it 'redirects to sign_in' do
- allow_any_instance_of(ApplicationSetting).to receive(:signup_enabled?).and_return(false)
+ stub_application_setting(signup_enabled: false)
expect { post(:create, params: user_params) }.not_to change(User, :count)
expect(response).to redirect_to(new_user_session_path)