Skip to content

Commit b4f3d3b

Browse files
committed
Merge pull request #1689 from bf4/unsubscribe_notification
Add missing unsubscribe from test
2 parents dd41e1b + 56662e9 commit b4f3d3b

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

test/action_controller/serialization_test.rb

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -454,13 +454,15 @@ def use_adapter?
454454
end
455455

456456
def test_render_event_is_emmited
457-
::ActiveSupport::Notifications.subscribe('render.active_model_serializers') do |name|
457+
subscriber = ::ActiveSupport::Notifications.subscribe('render.active_model_serializers') do |name|
458458
@name = name
459459
end
460460

461461
get :render_using_implicit_serializer
462462

463463
assert_equal 'render.active_model_serializers', @name
464+
ensure
465+
ActiveSupport::Notifications.unsubscribe(subscriber) if subscriber
464466
end
465467
end
466468
end

0 commit comments

Comments
 (0)