Merge pull request #2060 from betagouv/fix-bug
Forgot to change a local variable into an instance variable
This commit is contained in:
commit
e7995bd1c9
3 changed files with 3 additions and 3 deletions
|
@ -17,7 +17,7 @@ class Users::RegistrationsController < Devise::RegistrationsController
|
||||||
def create
|
def create
|
||||||
user = User.find_by(email: params[:user][:email])
|
user = User.find_by(email: params[:user][:email])
|
||||||
if user.present?
|
if user.present?
|
||||||
UserMailer.new_account_warning(user).deliver
|
UserMailer.new_account_warning(user).deliver_later
|
||||||
flash.notice = t('devise.registrations.signed_up_but_unconfirmed')
|
flash.notice = t('devise.registrations.signed_up_but_unconfirmed')
|
||||||
redirect_to root_path
|
redirect_to root_path
|
||||||
else
|
else
|
||||||
|
|
|
@ -5,6 +5,6 @@ class UserMailer < ApplicationMailer
|
||||||
@user = user
|
@user = user
|
||||||
@subject = "Demande de création de compte"
|
@subject = "Demande de création de compte"
|
||||||
|
|
||||||
mail(to: user.email, subject: subject)
|
mail(to: user.email, subject: @subject)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -37,7 +37,7 @@ describe Users::RegistrationsController, type: :controller do
|
||||||
let!(:existing_user) { create(:user, email: email, password: password) }
|
let!(:existing_user) { create(:user, email: email, password: password) }
|
||||||
|
|
||||||
before do
|
before do
|
||||||
allow(UserMailer).to receive(:new_account_warning).and_return(double(deliver: 'deliver'))
|
allow(UserMailer).to receive(:new_account_warning).and_return(double(deliver_later: 'deliver'))
|
||||||
subject
|
subject
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue