diff options
Diffstat (limited to 'spec/controllers/registrations_controller_spec.rb')
-rw-r--r-- | spec/controllers/registrations_controller_spec.rb | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/spec/controllers/registrations_controller_spec.rb b/spec/controllers/registrations_controller_spec.rb index d334a2ff566..fd151e8a298 100644 --- a/spec/controllers/registrations_controller_spec.rb +++ b/spec/controllers/registrations_controller_spec.rb @@ -17,7 +17,7 @@ describe RegistrationsController do it 'signs the user in' do allow_any_instance_of(ApplicationSetting).to receive(:send_user_confirmation_email).and_return(false) - expect { post(:create, user_params) }.not_to change { ActionMailer::Base.deliveries.size } + expect { post(:create, params: user_params) }.not_to change { ActionMailer::Base.deliveries.size } expect(subject.current_user).not_to be_nil end end @@ -26,7 +26,7 @@ describe RegistrationsController 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) - post(:create, user_params) + 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 @@ -37,7 +37,7 @@ describe RegistrationsController do it 'redirects to sign_in' do allow_any_instance_of(ApplicationSetting).to receive(:signup_enabled?).and_return(false) - expect { post(:create, user_params) }.not_to change(User, :count) + expect { post(:create, params: user_params) }.not_to change(User, :count) expect(response).to redirect_to(new_user_session_path) end end @@ -52,7 +52,7 @@ describe RegistrationsController do # Without this, `verify_recaptcha` arbitrarily returns true in test env Recaptcha.configuration.skip_verify_env.delete('test') - post(:create, user_params) + post(:create, params: user_params) expect(response).to render_template(:new) expect(flash[:alert]).to include 'There was an error with the reCAPTCHA. Please solve the reCAPTCHA again.' @@ -64,7 +64,7 @@ describe RegistrationsController do Recaptcha.configuration.skip_verify_env << 'test' end - post(:create, user_params) + post(:create, params: user_params) expect(flash[:notice]).to include 'Welcome! You have signed up successfully.' end @@ -76,13 +76,13 @@ describe RegistrationsController do end it 'redirects back with a notice when the checkbox was not checked' do - post :create, user_params + post :create, params: user_params expect(flash[:alert]).to match /you must accept our terms/i end it 'creates the user with agreement when terms are accepted' do - post :create, user_params.merge(terms_opt_in: '1') + post :create, params: user_params.merge(terms_opt_in: '1') expect(subject.current_user).to be_present expect(subject.current_user.terms_accepted?).to be(true) @@ -125,13 +125,13 @@ describe RegistrationsController do end it 'fails if password confirmation is wrong' do - post :destroy, password: 'wrong password' + post :destroy, params: { password: 'wrong password' } expect_password_failure end it 'succeeds if password is confirmed' do - post :destroy, password: '12345678' + post :destroy, params: { password: '12345678' } expect_success end @@ -150,13 +150,13 @@ describe RegistrationsController do end it 'fails if username confirmation is wrong' do - post :destroy, username: 'wrong username' + post :destroy, params: { username: 'wrong username' } expect_username_failure end it 'succeeds if username is confirmed' do - post :destroy, username: user.username + post :destroy, params: { username: user.username } expect_success end |