diff options
author | Rémy Coutable <remy@rymai.me> | 2016-01-15 17:57:45 +0100 |
---|---|---|
committer | Rémy Coutable <remy@rymai.me> | 2016-01-15 17:57:45 +0100 |
commit | 30a4f4c9e0cc44b67ea6041b8aef01196649b8d3 (patch) | |
tree | 366c7e542e583a1fa3af67227e5cd4717ce9491b /spec | |
parent | 55ae5394a05fbde53067336a17ff2f03733775a0 (diff) | |
download | gitlab-ce-30a4f4c9e0cc44b67ea6041b8aef01196649b8d3.tar.gz |
This will ensure previous assignee gets an email even if his notif level is "on mention"fix-consider-re-assign-as-a-mention
Diffstat (limited to 'spec')
-rw-r--r-- | spec/services/notification_service_spec.rb | 40 |
1 files changed, 40 insertions, 0 deletions
diff --git a/spec/services/notification_service_spec.rb b/spec/services/notification_service_spec.rb index b63903af414..2d0b5df4224 100644 --- a/spec/services/notification_service_spec.rb +++ b/spec/services/notification_service_spec.rb @@ -228,6 +228,46 @@ describe NotificationService, services: true do describe :reassigned_issue do it 'emails new assignee' do + notification.reassigned_issue(issue, @u_disabled) + + should_email(issue.assignee) + should_email(@u_watcher) + should_email(@u_participant_mentioned) + should_email(@subscriber) + should_not_email(@unsubscriber) + should_not_email(@u_participating) + should_not_email(@u_disabled) + end + + it 'emails previous assignee even if he has the "on mention" notif level' do + issue.update_attribute(:assignee, @u_mentioned) + issue.update_attributes(assignee: @u_watcher) + notification.reassigned_issue(issue, @u_disabled) + + should_email(@u_mentioned) + should_email(@u_watcher) + should_email(@u_participant_mentioned) + should_email(@subscriber) + should_not_email(@unsubscriber) + should_not_email(@u_participating) + should_not_email(@u_disabled) + end + + it 'emails new assignee even if he has the "on mention" notif level' do + issue.update_attributes(assignee: @u_mentioned) + notification.reassigned_issue(issue, @u_disabled) + + expect(issue.assignee).to be @u_mentioned + should_email(issue.assignee) + should_email(@u_watcher) + should_email(@u_participant_mentioned) + should_email(@subscriber) + should_not_email(@unsubscriber) + should_not_email(@u_participating) + should_not_email(@u_disabled) + end + + it 'emails new assignee' do issue.update_attribute(:assignee, @u_mentioned) notification.reassigned_issue(issue, @u_disabled) |