Make Reply-To config apply to change e-mail confirmation and other notifications

sent through Devise

Fix test case that was passing due to a broken `around` statement.

Closes #1556
This commit is contained in:
Stan Hu 2015-05-01 17:12:54 -07:00
parent 001c9731e6
commit 4dda17a5bf
4 changed files with 7 additions and 8 deletions

View File

@ -1,6 +1,7 @@
Please view this file on the master branch, on stable branches it's out of date.
v 7.11.0 (unreleased)
- Make Reply-To config apply to change e-mail confirmation and other Devise notifications (Stan Hu)
- Don't allow a merge request to be merged when its title starts with "WIP".
- Get Gitorious importer to work again.
- Fix clone URL field and X11 Primary selection (Dmitry Medvinsky)

View File

@ -0,0 +1,4 @@
class DeviseMailer < Devise::Mailer
default from: "GitLab <#{Gitlab.config.gitlab.email_from}>"
default reply_to: Gitlab.config.gitlab.email_reply_to
end

View File

@ -2,13 +2,8 @@
# four configuration values can also be set straight in your models.
Devise.setup do |config|
# ==> Mailer Configuration
# 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 = "GitLab <#{Gitlab.config.gitlab.email_from}>"
# Configure the class responsible to send e-mails.
# config.mailer = "Devise::Mailer"
config.mailer = "DeviseMailer"
# ==> ORM configuration
# Load and configure the ORM. Supports :active_record (default) and

View File

@ -11,9 +11,8 @@ describe Notify do
let(:recipient) { create(:user, email: 'recipient@example.com') }
let(:project) { create(:project) }
around(:each) { ActionMailer::Base.deliveries.clear }
before(:each) do
ActionMailer::Base.deliveries.clear
email = recipient.emails.create(email: "notifications@example.com")
recipient.update_attribute(:notification_email, email.email)
end