summaryrefslogtreecommitdiff
path: root/spec/services
diff options
context:
space:
mode:
authorhttp://jneen.net/ <jneen@jneen.net>2017-08-18 13:36:51 -0700
committerhttp://jneen.net/ <jneen@jneen.net>2017-08-21 15:34:23 -0700
commit4c68ff08bb2c48f85a3f3a79db14ec7402a8ba69 (patch)
tree6d7b56f006391a516a78500db49efaf54ecfe15e /spec/services
parent539ed0a6375d5bb6d734e688b801373e4b8006f9 (diff)
downloadgitlab-ce-4c68ff08bb2c48f85a3f3a79db14ec7402a8ba69.tar.gz
add a spec for a participant with a :custom setting
where that custom setting is not enabled.
Diffstat (limited to 'spec/services')
-rw-r--r--spec/services/notification_service_spec.rb16
1 files changed, 14 insertions, 2 deletions
diff --git a/spec/services/notification_service_spec.rb b/spec/services/notification_service_spec.rb
index 44b2d28d1d4..5223152ce66 100644
--- a/spec/services/notification_service_spec.rb
+++ b/spec/services/notification_service_spec.rb
@@ -130,7 +130,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
@@ -141,7 +152,7 @@ describe NotificationService, :mailer do
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)
@@ -153,6 +164,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)