File tree Expand file tree Collapse file tree 1 file changed +9
-3
lines changed Expand file tree Collapse file tree 1 file changed +9
-3
lines changed Original file line number Diff line number Diff line change @@ -457,13 +457,19 @@ def use_adapter?
457
457
end
458
458
459
459
def test_render_event_is_emitted
460
- subscriber = ::ActiveSupport ::Notifications . subscribe ( 'render.active_model_serializers' ) do |name |
461
- @name = name
460
+ subscriber = ::ActiveSupport ::Notifications . subscribe ( 'render.active_model_serializers' ) do |subscribed_event |
461
+ @subscribed_event = subscribed_event
462
462
end
463
463
464
464
get :render_using_implicit_serializer
465
465
466
- assert_equal 'render.active_model_serializers' , @name
466
+ subscribed_event_name =
467
+ if @subscribed_event . is_a? ( String )
468
+ @subscribed_event
469
+ else
470
+ @subscribed_event . name # is a ActiveSupport::Notifications::Event
471
+ end
472
+ assert_equal 'render.active_model_serializers' , subscribed_event_name
467
473
ensure
468
474
ActiveSupport ::Notifications . unsubscribe ( subscriber ) if subscriber
469
475
end
You can’t perform that action at this time.
0 commit comments