e6fe7f680d
It's kind of a long way to get from one to the other right now. Every event belongs to a bubble, so let's link them directly.
28 lines
773 B
Ruby
28 lines
773 B
Ruby
require "test_helper"
|
|
|
|
class Notifier::AssignedTest < ActiveSupport::TestCase
|
|
test "creates a notification for the assignee" do
|
|
notifications = Notifier.for(events(:logo_assignment_km)).generate
|
|
|
|
assert_equal [ users(:kevin) ], notifications.map(&:user)
|
|
end
|
|
|
|
test "does not notify for self-assignments" do
|
|
event = EventSummary.last.events.create! \
|
|
action: :assigned,
|
|
bubble: bubbles(:logo),
|
|
creator: users(:kevin),
|
|
particulars: { assignee_ids: [ users(:kevin).id ] }
|
|
|
|
assert_no_difference -> { Notification.count } do
|
|
Notifier.for(event).generate
|
|
end
|
|
end
|
|
|
|
test "links to the bubble" do
|
|
Notifier.for(events(:logo_assignment_km)).generate
|
|
|
|
assert_equal bubbles(:logo), Notification.last.resource
|
|
end
|
|
end
|