diff options
author | Sean McGivern <sean@gitlab.com> | 2018-03-30 12:58:06 +0100 |
---|---|---|
committer | Sean McGivern <sean@gitlab.com> | 2018-03-30 12:58:06 +0100 |
commit | ddb23d3b2ba7c646cff6a5d21957194fc3474418 (patch) | |
tree | 746675e221d4e552cbf7551b259f76b7645e5c99 /spec/services/notification_service_spec.rb | |
parent | f4c8517fec6d53e079f465d594ddef531e12c0af (diff) | |
download | gitlab-ce-ddb23d3b2ba7c646cff6a5d21957194fc3474418.tar.gz |
Send issue due emails to all participants
Diffstat (limited to 'spec/services/notification_service_spec.rb')
-rw-r--r-- | spec/services/notification_service_spec.rb | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/spec/services/notification_service_spec.rb b/spec/services/notification_service_spec.rb index 3943148f0db..1d117d9abc7 100644 --- a/spec/services/notification_service_spec.rb +++ b/spec/services/notification_service_spec.rb @@ -933,6 +933,37 @@ describe NotificationService, :mailer do let(:notification_trigger) { notification.issue_moved(issue, new_issue, @u_disabled) } end end + + describe '#issue_due' do + it 'sends email to issue notification recipients' do + notification.issue_due(issue) + + should_email(issue.assignees.first) + should_email(issue.author) + should_email(@u_watcher) + should_email(@u_guest_watcher) + should_email(@u_participant_mentioned) + should_email(@subscriber) + should_email(@watcher_and_subscriber) + should_not_email(@unsubscriber) + should_not_email(@u_participating) + should_not_email(@u_disabled) + should_not_email(@u_lazy_participant) + end + + it 'sends the email from the author' do + notification.issue_due(issue) + email = find_email_for(@subscriber) + + expect(email.header[:from].display_names).to eq([issue.author.name]) + end + + it_behaves_like 'participating notifications' do + let(:participant) { create(:user, username: 'user-participant') } + let(:issuable) { issue } + let(:notification_trigger) { notification.issue_due(issue) } + end + end end describe 'Merge Requests' do |