diff options
author | Pierre de La Morinerie <pierre@capitainetrain.com> | 2014-02-21 19:39:09 +0100 |
---|---|---|
committer | Pierre de La Morinerie <pierre@capitainetrain.com> | 2014-06-10 17:09:15 +0200 |
commit | 466b768bb34730ee6a24d950333c232009c34bbd (patch) | |
tree | 7ee2e0263b60e495c4c5013376d3564a92811f22 /spec | |
parent | 772f2f1ac8aab40a2cd62f285af131eb61ad12bb (diff) | |
download | gitlab-ce-466b768bb34730ee6a24d950333c232009c34bbd.tar.gz |
Send notification emails to the "project", and put people in Cc
This fixes email threading in Mail.app, that doesn't like when a thread
doesn't have stable recipients.
For instance, here is a possible sender-recipient combinations before:
From: A
To: Me
New issue
From: B
To: Me
Reply on new issue
From: A
To: Me
Another reply
Mail.app doesn't see B as a participant to the original email thread,
and decides to break the thread: it will group all messages from A
together, and separately all messages from B.
This commit makes the thread look like this:
From: A
To: gitlab/project
Cc: Me
New issue
From: B
To: gitlab/project
Cc: Me
Reply on new issue
From: A
To: gitlab/project
Cc: Me
Another reply
Mail.app sees a common recipient, and group the thread correctly.
Diffstat (limited to 'spec')
-rw-r--r-- | spec/mailers/notify_spec.rb | 8 | ||||
-rw-r--r-- | spec/services/issues/close_service_spec.rb | 2 | ||||
-rw-r--r-- | spec/services/issues/update_service_spec.rb | 2 | ||||
-rw-r--r-- | spec/services/merge_requests/close_service_spec.rb | 2 | ||||
-rw-r--r-- | spec/services/merge_requests/update_service_spec.rb | 2 |
5 files changed, 8 insertions, 8 deletions
diff --git a/spec/mailers/notify_spec.rb b/spec/mailers/notify_spec.rb index 547268d44f0..6725e350898 100644 --- a/spec/mailers/notify_spec.rb +++ b/spec/mailers/notify_spec.rb @@ -10,7 +10,7 @@ describe Notify do shared_examples 'a multiple recipients email' do it 'is sent to the given recipient' do - should deliver_to recipient.email + should cc_to recipient.email end end @@ -141,7 +141,7 @@ describe Notify do end it 'is sent to the assignee' do - should deliver_to assignee.email + should cc_to assignee.email end end @@ -394,7 +394,7 @@ describe Notify do end it 'is sent to the given recipient' do - should deliver_to recipient.email + should cc_to recipient.email end it 'contains the message from the note' do @@ -538,7 +538,7 @@ describe Notify do end it 'is sent to recipient' do - should deliver_to 'devs@company.name' + should cc_to 'devs@company.name' end it 'has the correct subject' do diff --git a/spec/services/issues/close_service_spec.rb b/spec/services/issues/close_service_spec.rb index d4f2cc1339b..7324650d534 100644 --- a/spec/services/issues/close_service_spec.rb +++ b/spec/services/issues/close_service_spec.rb @@ -22,7 +22,7 @@ describe Issues::CloseService do it 'should send email to user2 about assign of new issue' do email = ActionMailer::Base.deliveries.last - email.to.first.should == user2.email + email.cc.first.should == user2.email email.subject.should include(issue.title) end diff --git a/spec/services/issues/update_service_spec.rb b/spec/services/issues/update_service_spec.rb index 347560414e7..47d18565034 100644 --- a/spec/services/issues/update_service_spec.rb +++ b/spec/services/issues/update_service_spec.rb @@ -31,7 +31,7 @@ describe Issues::UpdateService do it 'should send email to user2 about assign of new issue' do email = ActionMailer::Base.deliveries.last - email.to.first.should == user2.email + email.cc.first.should == user2.email email.subject.should include(issue.title) end diff --git a/spec/services/merge_requests/close_service_spec.rb b/spec/services/merge_requests/close_service_spec.rb index a504f916b08..2c5a7c4f26c 100644 --- a/spec/services/merge_requests/close_service_spec.rb +++ b/spec/services/merge_requests/close_service_spec.rb @@ -22,7 +22,7 @@ describe MergeRequests::CloseService do it 'should send email to user2 about assign of new merge_request' do email = ActionMailer::Base.deliveries.last - email.to.first.should == user2.email + email.cc.first.should == user2.email email.subject.should include(merge_request.title) end diff --git a/spec/services/merge_requests/update_service_spec.rb b/spec/services/merge_requests/update_service_spec.rb index af5d3a3dc81..42ac05862b3 100644 --- a/spec/services/merge_requests/update_service_spec.rb +++ b/spec/services/merge_requests/update_service_spec.rb @@ -31,7 +31,7 @@ describe MergeRequests::UpdateService do it 'should send email to user2 about assign of new merge_request' do email = ActionMailer::Base.deliveries.last - email.to.first.should == user2.email + email.cc.first.should == user2.email email.subject.should include(merge_request.title) end |