diff options
Diffstat (limited to 'spec/mailers')
-rw-r--r-- | spec/mailers/notify_spec.rb | 7 | ||||
-rw-r--r-- | spec/mailers/shared/notify.rb | 10 |
2 files changed, 10 insertions, 7 deletions
diff --git a/spec/mailers/notify_spec.rb b/spec/mailers/notify_spec.rb index 8dc5e0b34d2..cd8578b6f49 100644 --- a/spec/mailers/notify_spec.rb +++ b/spec/mailers/notify_spec.rb @@ -1094,11 +1094,4 @@ describe Notify do is_expected.to have_body_text /#{diff_path}/ end end - - describe 'email has correct subject' do - it 'has correct suffix' do - stub_config_setting(email_subject_suffix: 'A Nice Suffix') - is_expected.to have_subject /\| A Nice Suffix$/ - end - end end diff --git a/spec/mailers/shared/notify.rb b/spec/mailers/shared/notify.rb index 5c9851f14c7..33d1075c739 100644 --- a/spec/mailers/shared/notify.rb +++ b/spec/mailers/shared/notify.rb @@ -37,6 +37,16 @@ shared_examples 'an email sent from GitLab' do reply_to = subject.header[:reply_to].addresses expect(reply_to).to eq([gitlab_sender_reply_to]) end + + context 'when custom suffix for email subject is set' do + before do + stub_config_setting(email_subject_suffix: 'A Nice Suffix') + end + + it 'ends the subject with the suffix' do + is_expected.to have_subject (/ \| A Nice Suffix$/) + end + end end shared_examples 'an email that contains a header with author username' do |