summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFu Xu <fuxu@fuxu.name>2016-09-28 16:14:47 +0800
committerFu Xu <fuxu@fuxu.name>2016-10-03 18:07:28 +0800
commit048f124a0851a51c449881814dbfd2f2fc2dd32d (patch)
tree1feb362fbb4bea77d070b9d18376471b2f994b1b
parent2a438f452c920e57545add519ed7b7a2c15e660e (diff)
downloadgitlab-ce-048f124a0851a51c449881814dbfd2f2fc2dd32d.tar.gz
move spec back into shared example `an email sent from GitLab`
-rw-r--r--spec/mailers/notify_spec.rb7
-rw-r--r--spec/mailers/shared/notify.rb10
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