20 lines
570 B
Ruby
20 lines
570 B
Ruby
require "test_helper"
|
|
|
|
class Notifier::CreatedTest < ActiveSupport::TestCase
|
|
test "creates a notification for each recipient" do
|
|
assert_difference -> { Notification.count }, 2 do
|
|
assert_difference -> { users(:kevin).notifications.count }, 1 do
|
|
assert_difference -> { users(:jz).notifications.count }, 1 do
|
|
Notifier.for(events(:logo_created)).generate
|
|
end
|
|
end
|
|
end
|
|
end
|
|
|
|
test "links to the bubble" do
|
|
Notifier.for(events(:logo_created)).generate
|
|
|
|
assert_equal bubbles(:logo), Notification.last.resource
|
|
end
|
|
end
|