summaryrefslogtreecommitdiff
path: root/spec
diff options
context:
space:
mode:
authorDouwe Maan <douwe@gitlab.com>2016-02-09 14:12:56 +0000
committerDouwe Maan <douwe@gitlab.com>2016-02-09 14:12:56 +0000
commit706b101f510b9a1f5acff51bb2f1b14c018b37ce (patch)
treeda359ce2b19e26d885e0742bcaf13e5d6d73fea6 /spec
parent80352b783ce359b70879bc7f2d571f219ae45bb1 (diff)
parent9474e36f462522af1804e760e5fe134f101fce08 (diff)
downloadgitlab-ce-706b101f510b9a1f5acff51bb2f1b14c018b37ce.tar.gz
Merge branch 'huacnlee/gitlab-ce-feature/option-to-include-author-info-in-mail' into 'master'
Add option to include the sender name in body of Notify email _Originally opened at !2495 by @huacnlee._ - - - Fixes #7824. See merge request !2767
Diffstat (limited to 'spec')
-rw-r--r--spec/mailers/notify_spec.rb37
1 files changed, 37 insertions, 0 deletions
diff --git a/spec/mailers/notify_spec.rb b/spec/mailers/notify_spec.rb
index 7289e596ef3..82bd057b16c 100644
--- a/spec/mailers/notify_spec.rb
+++ b/spec/mailers/notify_spec.rb
@@ -270,6 +270,17 @@ describe Notify do
it 'contains a link to the new issue' do
is_expected.to have_body_text /#{namespace_project_issue_path project.namespace, project, issue}/
end
+
+ context 'when enabled email_author_in_body' do
+ before do
+ allow(current_application_settings).to receive(:email_author_in_body).and_return(true)
+ end
+
+ it 'contains a link to note author' do
+ is_expected.to have_body_text issue.author_name
+ is_expected.to have_body_text /wrote\:/
+ end
+ end
end
describe 'that are new with a description' do
@@ -377,6 +388,17 @@ describe Notify do
it 'has the correct message-id set' do
is_expected.to have_header 'Message-ID', "<merge_request_#{merge_request.id}@#{Gitlab.config.gitlab.host}>"
end
+
+ context 'when enabled email_author_in_body' do
+ before do
+ allow(current_application_settings).to receive(:email_author_in_body).and_return(true)
+ end
+
+ it 'contains a link to note author' do
+ is_expected.to have_body_text merge_request.author_name
+ is_expected.to have_body_text /wrote\:/
+ end
+ end
end
describe 'that are new with a description' do
@@ -550,6 +572,21 @@ describe Notify do
it 'contains the message from the note' do
is_expected.to have_body_text /#{note.note}/
end
+
+ it 'not contains note author' do
+ is_expected.not_to have_body_text /wrote\:/
+ end
+
+ context 'when enabled email_author_in_body' do
+ before do
+ allow(current_application_settings).to receive(:email_author_in_body).and_return(true)
+ end
+
+ it 'contains a link to note author' do
+ is_expected.to have_body_text note.author_name
+ is_expected.to have_body_text /wrote\:/
+ end
+ end
end
describe 'on a commit' do