mirror of
https://github.com/ditkrg/active_model_serializers.git
synced 2026-01-23 06:16:50 +00:00
Remove outdated regression test
Per https://github.com/rails-api/active_model_serializers/pull/1390#discussion_r48322329
This commit is contained in:
parent
9779185d57
commit
f5e2b991bf
@ -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
|
||||
|
||||
1
test/fixtures/template.html.erb
vendored
1
test/fixtures/template.html.erb
vendored
@ -1 +0,0 @@
|
||||
<p>Hello.</p>
|
||||
Loading…
Reference in New Issue
Block a user