diff --git a/test/active_model_serializers/test/serializer_test.rb b/test/active_model_serializers/test/serializer_test.rb index c6c10b71..c4773d9b 100644 --- a/test/active_model_serializers/test/serializer_test.rb +++ b/test/active_model_serializers/test/serializer_test.rb @@ -6,7 +6,6 @@ module ActiveModelSerializers include ActiveModelSerializers::Test::Serializer class MyController < ActionController::Base - TEMPLATE_NAME = 'template' def render_using_serializer render json: Profile.new(name: 'Name 1', description: 'Description 1', comments: 'Comments 1') end @@ -15,11 +14,6 @@ module ActiveModelSerializers def render_some_text Rails.version > '4.1' ? render(plain: 'ok') : render(text: 'ok') end - - def render_a_template - prepend_view_path './test/fixtures' - render template: TEMPLATE_NAME - end end tests MyController @@ -64,23 +58,6 @@ module ActiveModelSerializers end assert_match 'assert_serializer only accepts a String, Symbol, Regexp, ActiveModel::Serializer, or nil', e.message end - - def test_does_not_overwrite_notification_subscriptions - payloads = [] - event_name = '!render_template.action_view' - ActiveSupport::Notifications.subscribe(event_name) do |_name, _start, _finish, _id, payload| - payloads << payload - end - - get :render_a_template - - assert_equal 1, payloads.size, 'Only expected one template rendering to be registered' - payload = payloads.first - assert_equal MyController::TEMPLATE_NAME, payload[:virtual_path] - assert_match %r{test/fixtures/#{MyController::TEMPLATE_NAME}.html.erb}, payload[:identifier] - ensure - ActiveSupport::Notifications.unsubscribe(event_name) - end end end end diff --git a/test/fixtures/template.html.erb b/test/fixtures/template.html.erb deleted file mode 100644 index 1f87be87..00000000 --- a/test/fixtures/template.html.erb +++ /dev/null @@ -1 +0,0 @@ -

Hello.