diff options
author | Fu Xu <fuxu@fuxu.name> | 2016-09-27 01:06:57 +0800 |
---|---|---|
committer | Fu Xu <fuxu@fuxu.name> | 2016-10-03 18:07:28 +0800 |
commit | 785094e201a7d3e7c88f9556da8d9539281a36d5 (patch) | |
tree | 08be5764519d1bd88b2215ec48e22e3c799d386f /spec/mailers | |
parent | f3f7f3fe8410cd8213cbc9b736d005ac85cbe980 (diff) | |
download | gitlab-ce-785094e201a7d3e7c88f9556da8d9539281a36d5.tar.gz |
create new test in `spec/mailers/notify_spec.rb`
Diffstat (limited to 'spec/mailers')
-rw-r--r-- | spec/mailers/notify_spec.rb | 11 | ||||
-rw-r--r-- | spec/mailers/shared/notify.rb | 4 |
2 files changed, 11 insertions, 4 deletions
diff --git a/spec/mailers/notify_spec.rb b/spec/mailers/notify_spec.rb index cd8578b6f49..03e0bfd3614 100644 --- a/spec/mailers/notify_spec.rb +++ b/spec/mailers/notify_spec.rb @@ -1094,4 +1094,15 @@ describe Notify do is_expected.to have_body_text /#{diff_path}/ end end + + describe 'email has correct subject' do + let(:gitlab_subject_suffix) { Gitlab.config.gitlab.email_subject_suffix } + + it 'has correct suffix' do + if gitlab_subject_suffix.length > 0 + is_expected.to have_subject gitlab_subject_suffix + end + end + end + end diff --git a/spec/mailers/shared/notify.rb b/spec/mailers/shared/notify.rb index de1d8995534..5c9851f14c7 100644 --- a/spec/mailers/shared/notify.rb +++ b/spec/mailers/shared/notify.rb @@ -2,7 +2,6 @@ shared_context 'gitlab email notification' do let(:gitlab_sender_display_name) { Gitlab.config.gitlab.email_display_name } let(:gitlab_sender) { Gitlab.config.gitlab.email_from } let(:gitlab_sender_reply_to) { Gitlab.config.gitlab.email_reply_to } - let(:gitlab_subject_suffix) { Gitlab.config.gitlab.email_subject_suffix } let(:recipient) { create(:user, email: 'recipient@example.com') } let(:project) { create(:project) } let(:new_user_address) { 'newguy@example.com' } @@ -32,9 +31,6 @@ shared_examples 'an email sent from GitLab' do sender = subject.header[:from].addrs[0] expect(sender.display_name).to eq(gitlab_sender_display_name) expect(sender.address).to eq(gitlab_sender) - if gitlab_subject_suffix.length > 0 - is_expected.to have_subject gitlab_subject_suffix - end end it 'has a Reply-To address' do |