diff --git a/app/models/notifier/assigned.rb b/app/models/notifier/assigned.rb index 1fa1818f3..283011b2a 100644 --- a/app/models/notifier/assigned.rb +++ b/app/models/notifier/assigned.rb @@ -1,2 +1,6 @@ class Notifier::Assigned < Notifier + private + def recipients + event.assignees + end end diff --git a/test/models/notifier_test.rb b/test/models/notifier_test.rb index aeddd9459..9e41ab3f4 100644 --- a/test/models/notifier_test.rb +++ b/test/models/notifier_test.rb @@ -33,4 +33,10 @@ class NotifierTest < ActiveSupport::TestCase assert_equal bubbles(:logo), Notification.last.resource end + + test "for assignment events only create a notification for the assignee" do + notifications = Notifier.for(events(:logo_assignment_jz)).generate + + assert_equal [ users(:jz) ], notifications.map(&:user) + end end