diff options
author | Sean McGivern <sean@gitlab.com> | 2018-03-30 14:58:20 +0300 |
---|---|---|
committer | Sean McGivern <sean@gitlab.com> | 2018-03-30 14:58:20 +0300 |
commit | 6412c4c54a7a824e108899a34b1ecec5cbdcec4b (patch) | |
tree | afe9fa7485520c60d91315d8f73c6f1d64108c8c /spec/services/notification_service_spec.rb | |
parent | ddb23d3b2ba7c646cff6a5d21957194fc3474418 (diff) | |
parent | fa1eabe8e82f7635f2aa51733c727728577c7644 (diff) |
Merge branch 'master' into stuartnelson3/gitlab-ce-stn/issue-due-email
Diffstat (limited to 'spec/services/notification_service_spec.rb')
-rw-r--r-- | spec/services/notification_service_spec.rb | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/spec/services/notification_service_spec.rb b/spec/services/notification_service_spec.rb index 1d117d9abc7..e7c7706b484 100644 --- a/spec/services/notification_service_spec.rb +++ b/spec/services/notification_service_spec.rb @@ -1121,6 +1121,36 @@ describe NotificationService, :mailer do end end + describe '#push_to_merge_request' do + before do + update_custom_notification(:push_to_merge_request, @u_guest_custom, resource: project) + update_custom_notification(:push_to_merge_request, @u_custom_global) + end + + it do + notification.push_to_merge_request(merge_request, @u_disabled) + + should_email(merge_request.assignee) + should_email(@u_guest_custom) + should_email(@u_custom_global) + should_email(@u_participant_mentioned) + should_email(@subscriber) + should_email(@watcher_and_subscriber) + should_not_email(@u_watcher) + should_not_email(@u_guest_watcher) + should_not_email(@unsubscriber) + should_not_email(@u_participating) + should_not_email(@u_disabled) + should_not_email(@u_lazy_participant) + end + + it_behaves_like 'participating notifications' do + let(:participant) { create(:user, username: 'user-participant') } + let(:issuable) { merge_request } + let(:notification_trigger) { notification.push_to_merge_request(merge_request, @u_disabled) } + end + end + describe '#relabel_merge_request' do let(:group_label_1) { create(:group_label, group: group, title: 'Group Label 1', merge_requests: [merge_request]) } let(:group_label_2) { create(:group_label, group: group, title: 'Group Label 2') } |