From 32a6f41f1cd5bbea690461d2e930843266893f1b Mon Sep 17 00:00:00 2001 From: Pierre de La Morinerie Date: Tue, 8 Jul 2014 13:56:37 +0200 Subject: Include "Merge-request reopened" emails in the proper email thread --- spec/mailers/notify_spec.rb | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) (limited to 'spec/mailers') diff --git a/spec/mailers/notify_spec.rb b/spec/mailers/notify_spec.rb index 314b2691c40..25872b3a257 100644 --- a/spec/mailers/notify_spec.rb +++ b/spec/mailers/notify_spec.rb @@ -322,6 +322,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) } -- cgit v1.2.1