diff options
author | Jason Lee <huacnlee@gmail.com> | 2016-01-26 21:34:42 +0800 |
---|---|---|
committer | Rémy Coutable <remy@rymai.me> | 2016-02-09 12:58:13 +0100 |
commit | 9474e36f462522af1804e760e5fe134f101fce08 (patch) | |
tree | b58b50cbd00970d1bc8320850f9a4d3eb38516e9 /spec | |
parent | 2837f5c179ebef57de4cbaa7587173d35a4cb397 (diff) | |
download | gitlab-ce-9474e36f462522af1804e760e5fe134f101fce08.tar.gz |
Add option to include the sender name in body of Notify email. fix #7824huacnlee/gitlab-ce-feature/option-to-include-author-info-in-mail
Diffstat (limited to 'spec')
-rw-r--r-- | spec/mailers/notify_spec.rb | 37 |
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 |