@@ -432,42 +432,4 @@ class TrilogyAdapterTest < ActiveRecord::TrilogyTestCase
432
432
ActiveRecord ::ConnectionAdapters ::TrilogyAdapter . new ( prepared_statements : true ) . connect!
433
433
end
434
434
end
435
-
436
- # Create a temporary subscription to verify notification is sent.
437
- # Optionally verify the notification payload includes expected types.
438
- def assert_notification ( notification , expected_payload = { } , &block )
439
- notification_sent = false
440
-
441
- subscription = lambda do |_ , _ , _ , _ , payload |
442
- notification_sent = true
443
-
444
- expected_payload . each do |key , value |
445
- assert (
446
- value === payload [ key ] ,
447
- "Expected notification payload[:#{ key } ] to match #{ value . inspect } , but got #{ payload [ key ] . inspect } ."
448
- )
449
- end
450
- end
451
-
452
- ActiveSupport ::Notifications . subscribed ( subscription , notification ) do
453
- block . call if block_given?
454
- end
455
-
456
- assert notification_sent , "#{ notification } notification was not sent"
457
- end
458
-
459
- # Create a temporary subscription to verify notification was not sent.
460
- def assert_no_notification ( notification , &block )
461
- notification_sent = false
462
-
463
- subscription = lambda do |*args |
464
- notification_sent = true
465
- end
466
-
467
- ActiveSupport ::Notifications . subscribed ( subscription , notification ) do
468
- block . call if block_given?
469
- end
470
-
471
- assert_not notification_sent , "#{ notification } notification was sent"
472
- end
473
435
end
0 commit comments