Don't bundle new notifications is bundling is disabled
This commit is contained in:
@@ -3,6 +3,7 @@ require "test_helper"
|
||||
class Notification::BundleTest < ActiveSupport::TestCase
|
||||
setup do
|
||||
@user = users(:david)
|
||||
@user.settings.bundle_email_every_few_hours!
|
||||
end
|
||||
|
||||
test "new notifications are bundled" do
|
||||
@@ -14,6 +15,14 @@ class Notification::BundleTest < ActiveSupport::TestCase
|
||||
assert_includes bundle.notifications, notification
|
||||
end
|
||||
|
||||
test "don't bundle new notifications if bundling is disabled" do
|
||||
@user.settings.bundle_email_never!
|
||||
|
||||
assert_no_difference -> { @user.notification_bundles.count } do
|
||||
@user.notifications.create!(source: events(:logo_published), creator: @user)
|
||||
end
|
||||
end
|
||||
|
||||
test "notifications are bundled withing the aggregation period" do
|
||||
notification_1 = assert_difference -> { @user.notification_bundles.pending.count }, 1 do
|
||||
@user.notifications.create!(source: events(:logo_published), creator: @user)
|
||||
|
||||
Reference in New Issue
Block a user