summaryrefslogtreecommitdiff
path: root/spec/mailers
diff options
context:
space:
mode:
authorDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>2014-08-12 12:28:19 +0000
committerDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>2014-08-12 12:28:19 +0000
commit53ead2e35c9195ae1f68bf5d7154e341636caf1b (patch)
treed8bbff65d339ab045f0b68344aed337cb878a62d /spec/mailers
parent3d99622c2da704e319c799c40a64f35f043205d4 (diff)
parent32a6f41f1cd5bbea690461d2e930843266893f1b (diff)
downloadgitlab-ce-53ead2e35c9195ae1f68bf5d7154e341636caf1b.tar.gz
Merge branch 'more-email-threading' into 'master'
Additions to email threading This MR follows !142: * Add threading to "Merge request reopened" emails (see 310231dbed83e66ad4d17b8c25f225f60b30eeb7) See merge request !145
Diffstat (limited to 'spec/mailers')
-rw-r--r--spec/mailers/notify_spec.rb29
1 files changed, 29 insertions, 0 deletions
diff --git a/spec/mailers/notify_spec.rb b/spec/mailers/notify_spec.rb
index a337408630b..702431e0712 100644
--- a/spec/mailers/notify_spec.rb
+++ b/spec/mailers/notify_spec.rb
@@ -323,6 +323,35 @@ describe Notify do
end
end
+ describe 'status changed' do
+ let(:status) { 'reopened' }
+ subject { Notify.merge_request_status_email(recipient.id, merge_request.id, status, current_user) }
+
+ it_behaves_like 'an answer to an existing thread', 'merge_request'
+
+ it 'is sent as the author' do
+ sender = subject.header[:from].addrs[0]
+ sender.display_name.should eq(current_user.name)
+ sender.address.should eq(gitlab_sender)
+ end
+
+ it 'has the correct subject' do
+ should have_subject /#{merge_request.title} \(##{merge_request.iid}\)/i
+ end
+
+ it 'contains the new status' do
+ should have_body_text /#{status}/i
+ end
+
+ it 'contains the user name' do
+ should have_body_text /#{current_user.name}/i
+ end
+
+ it 'contains a link to the merge request' do
+ should have_body_text /#{project_merge_request_path project, merge_request}/
+ end
+ end
+
describe 'that are merged' do
subject { Notify.merged_merge_request_email(recipient.id, merge_request.id, merge_author.id) }