diff options
author | Sean McGivern <sean@mcgivern.me.uk> | 2017-08-28 10:12:41 +0000 |
---|---|---|
committer | Jose Ivan Vargas <jvargas@gitlab.com> | 2017-09-01 12:43:48 -0500 |
commit | c9d9447325a8bcf9e78a49c115b9368d65877072 (patch) | |
tree | 823804ab4ee6e705ef7025d4388c8af84db29325 /spec/services | |
parent | 6b5266503aea883fe80a3c8ae21cff53fc98af0c (diff) | |
download | gitlab-ce-c9d9447325a8bcf9e78a49c115b9368d65877072.tar.gz |
Merge branch 'bugfix.notify-custom-participants' into 'master'
Bugfix.notify custom participants
Closes #36610
See merge request !13680
Diffstat (limited to 'spec/services')
-rw-r--r-- | spec/services/notification_service_spec.rb | 17 |
1 files changed, 14 insertions, 3 deletions
diff --git a/spec/services/notification_service_spec.rb b/spec/services/notification_service_spec.rb index 6af5c79135d..2740757fabc 100644 --- a/spec/services/notification_service_spec.rb +++ b/spec/services/notification_service_spec.rb @@ -126,7 +126,18 @@ describe NotificationService, :mailer do project.add_master(issue.author) project.add_master(assignee) project.add_master(note.author) - create(:note_on_issue, noteable: issue, project_id: issue.project_id, note: '@subscribed_participant cc this guy') + + @u_custom_off = create_user_with_notification(:custom, 'custom_off') + project.add_guest(@u_custom_off) + + create( + :note_on_issue, + author: @u_custom_off, + noteable: issue, + project_id: issue.project_id, + note: 'i think @subscribed_participant should see this' + ) + update_custom_notification(:new_note, @u_guest_custom, resource: project) update_custom_notification(:new_note, @u_custom_global) end @@ -136,8 +147,7 @@ describe NotificationService, :mailer do add_users_with_subscription(note.project, issue) reset_delivered_emails! - # Ensure create SentNotification by noteable = issue 6 times, not noteable = note - expect(SentNotification).to receive(:record).with(issue, any_args).exactly(8).times + expect(SentNotification).to receive(:record).with(issue, any_args).exactly(9).times notification.new_note(note) @@ -149,6 +159,7 @@ describe NotificationService, :mailer do should_email(@subscriber) should_email(@watcher_and_subscriber) should_email(@subscribed_participant) + should_email(@u_custom_off) should_not_email(@u_guest_custom) should_not_email(@u_guest_watcher) should_not_email(note.author) |