Commit 76463c2c authored by Fu Xu's avatar Fu Xu

override subject method in devise mailer

parent 064eb2ca
...@@ -3,4 +3,12 @@ class DeviseMailer < Devise::Mailer ...@@ -3,4 +3,12 @@ class DeviseMailer < Devise::Mailer
default reply_to: Gitlab.config.gitlab.email_reply_to default reply_to: Gitlab.config.gitlab.email_reply_to
layout 'devise_mailer' layout 'devise_mailer'
protected
def subject_for(key)
subject = super
subject << " | #{Gitlab.config.gitlab.email_subject_suffix}" if Gitlab.config.gitlab.email_subject_suffix.length > 0
subject
end
end end
...@@ -831,6 +831,7 @@ describe Notify do ...@@ -831,6 +831,7 @@ describe Notify do
let(:user) { create(:user, email: 'old-email@mail.com') } let(:user) { create(:user, email: 'old-email@mail.com') }
before do before do
stub_config_setting(email_subject_suffix: 'A Nice Suffix')
perform_enqueued_jobs do perform_enqueued_jobs do
user.email = "new-email@mail.com" user.email = "new-email@mail.com"
user.save user.save
...@@ -847,7 +848,7 @@ describe Notify do ...@@ -847,7 +848,7 @@ describe Notify do
end end
it 'has the correct subject' do it 'has the correct subject' do
is_expected.to have_subject "Confirmation instructions" is_expected.to have_subject /^Confirmation instructions/
end end
it 'includes a link to the site' do it 'includes a link to the site' do
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment