Test to make sure it skips bundles that are not due

This commit is contained in:
Jorge Manrubia
2025-08-27 15:51:20 +02:00
parent ccceeb1699
commit 5a4c40fd56
+15
View File
@@ -91,4 +91,19 @@ class Notification::BundleTest < ActiveSupport::TestCase
bundle.reload
assert bundle.delivered?
end
test "deliver_all don't deliver bundles that are not due" do
@user.notifications.create!(source: events(:logo_published), creator: @user)
bundle = @user.notification_bundles.pending.last
bundle.update!(ends_at: 1.minute.from_now)
perform_enqueued_jobs do
Notification::Bundle.deliver_all
end
bundle.reload
assert bundle.pending?
end
end