diff options
Diffstat (limited to 'actionview/test/actionpack')
3 files changed, 15 insertions, 15 deletions
diff --git a/actionview/test/actionpack/abstract/abstract_controller_test.rb b/actionview/test/actionpack/abstract/abstract_controller_test.rb index eecc19d413..2de81596b5 100644 --- a/actionview/test/actionpack/abstract/abstract_controller_test.rb +++ b/actionview/test/actionpack/abstract/abstract_controller_test.rb @@ -230,6 +230,7 @@ module AbstractController class ActionMissingRespondToActionController < AbstractController::Base # No actions + private def action_missing(action_name) self.response_body = "success" @@ -242,7 +243,6 @@ module AbstractController def fail() self.response_body = "fail" end private - def method_for_action(action_name) action_name.to_s != "fail" && action_name end diff --git a/actionview/test/actionpack/abstract/layouts_test.rb b/actionview/test/actionpack/abstract/layouts_test.rb index 1146e6f64b..15643c161d 100644 --- a/actionview/test/actionpack/abstract/layouts_test.rb +++ b/actionview/test/actionpack/abstract/layouts_test.rb @@ -140,6 +140,7 @@ module AbstractControllerTests def index render template: ActionView::Template::Text.new("Hello symbol!") end + private def hello "overwrite" @@ -295,7 +296,7 @@ module AbstractControllerTests 10.times do |x| controller = WithString.new controller.define_singleton_method :index do - render template: ActionView::Template::Text.new("Hello string!"), locals: { :"x#{x}" => :omg } + render template: ActionView::Template::Text.new("Hello string!"), locals: { "x#{x}": :omg } end controller.process(:index) end diff --git a/actionview/test/actionpack/controller/render_test.rb b/actionview/test/actionpack/controller/render_test.rb index c8ce7366d1..64070a9542 100644 --- a/actionview/test/actionpack/controller/render_test.rb +++ b/actionview/test/actionpack/controller/render_test.rb @@ -607,7 +607,6 @@ class TestController < ActionController::Base end private - def set_variable_for_layout @variable_for_layout = nil end @@ -1003,14 +1002,14 @@ class RenderTest < ActionController::TestCase def test_render_xml get :render_xml_hello assert_equal "<html>\n <p>Hello David</p>\n<p>This is grand!</p>\n</html>\n", @response.body - assert_equal "application/xml", @response.content_type + assert_equal "application/xml", @response.media_type end # :ported: def test_render_xml_as_string_template get :render_xml_hello_as_string_template assert_equal "<html>\n <p>Hello David</p>\n<p>This is grand!</p>\n</html>\n", @response.body - assert_equal "application/xml", @response.content_type + assert_equal "application/xml", @response.media_type end # :ported: @@ -1039,7 +1038,7 @@ class RenderTest < ActionController::TestCase def test_rendered_format_without_format get :inline_rendered_format_without_format assert_equal "test", @response.body - assert_equal "text/html", @response.content_type + assert_equal "text/html", @response.media_type end def test_partials_list @@ -1077,7 +1076,7 @@ class RenderTest < ActionController::TestCase def test_accessing_local_assigns_in_inline_template get :accessing_local_assigns_in_inline_template, params: { local_name: "Local David" } assert_equal "Goodbye, Local David", @response.body - assert_equal "text/html", @response.content_type + assert_equal "text/html", @response.media_type end def test_should_implicitly_render_html_template_from_xhr_request @@ -1264,13 +1263,13 @@ class RenderTest < ActionController::TestCase def test_partial_only get :partial_only assert_equal "only partial", @response.body - assert_equal "text/html", @response.content_type + assert_equal "text/html", @response.media_type end def test_should_render_html_formatted_partial get :partial assert_equal "partial html", @response.body - assert_equal "text/html", @response.content_type + assert_equal "text/html", @response.media_type end def test_render_html_formatted_partial_even_with_other_mime_time_in_accept @@ -1279,20 +1278,20 @@ class RenderTest < ActionController::TestCase get :partial_html_erb assert_equal "partial.html.erb", @response.body.strip - assert_equal "text/html", @response.content_type + assert_equal "text/html", @response.media_type end def test_should_render_html_partial_with_formats get :partial_formats_html assert_equal "partial html", @response.body - assert_equal "text/html", @response.content_type + assert_equal "text/html", @response.media_type end def test_render_to_string_partial get :render_to_string_with_partial assert_equal "only partial", @controller.instance_variable_get(:@partial_only) assert_equal "Hello: david", @controller.instance_variable_get(:@partial_with_locals) - assert_equal "text/html", @response.content_type + assert_equal "text/html", @response.media_type end def test_render_to_string_with_template_and_html_partial @@ -1300,21 +1299,21 @@ class RenderTest < ActionController::TestCase assert_equal "**only partial**\n", @controller.instance_variable_get(:@text) assert_equal "<strong>only partial</strong>\n", @controller.instance_variable_get(:@html) assert_equal "<strong>only html partial</strong>\n", @response.body - assert_equal "text/html", @response.content_type + assert_equal "text/html", @response.media_type end def test_render_to_string_and_render_with_different_formats get :render_to_string_and_render_with_different_formats assert_equal "<strong>only partial</strong>\n", @controller.instance_variable_get(:@html) assert_equal "**only partial**\n", @response.body - assert_equal "text/plain", @response.content_type + assert_equal "text/plain", @response.media_type end def test_render_template_within_a_template_with_other_format get :render_template_within_a_template_with_other_format expected = "only html partial<p>This is grand!</p>" assert_equal expected, @response.body.strip - assert_equal "text/html", @response.content_type + assert_equal "text/html", @response.media_type end def test_partial_with_counter |