Devise won't read mail from Settings in test environment

This commit is contained in:
Fernando Blat
2016-12-23 15:45:20 +01:00
parent a07fbc5b41
commit 85ce7d7227

View File

@@ -12,7 +12,11 @@ Devise.setup do |config|
# Configure the e-mail address which will be shown in Devise::Mailer,
# note that it will be overwritten if you use your own mailer class
# with default "from" parameter.
config.mailer_sender = "#{Setting['mailer_from_name']} <#{Setting['mailer_from_address']}>"
if Rails.env.test?
config.mailer_sender = "noreply@example.org"
else
config.mailer_sender = "#{Setting['mailer_from_name']} <#{Setting['mailer_from_address']}>"
end
# Configure the class responsible to send e-mails.
config.mailer = 'DeviseMailer'