aboutsummaryrefslogtreecommitdiffstats
path: root/actionview/test/actionpack
diff options
context:
space:
mode:
authorAaron Patterson <aaron.patterson@gmail.com>2019-02-13 17:17:48 -0800
committerAaron Patterson <aaron.patterson@gmail.com>2019-02-19 13:46:09 -0800
commitd0733ba8c0528aa4bc6e890e189afaac62ebe58f (patch)
treeb40eb4ffa2394eba5efad7ac93f0eef5eef1ba8f /actionview/test/actionpack
parent4f77982e213e31d9c6e7195c7db86429b8092744 (diff)
downloadrails-d0733ba8c0528aa4bc6e890e189afaac62ebe58f.tar.gz
rails-d0733ba8c0528aa4bc6e890e189afaac62ebe58f.tar.bz2
rails-d0733ba8c0528aa4bc6e890e189afaac62ebe58f.zip
Move inline rendering content-type test to a controller test
This commit is to remove direct access to the "rendered_format" attribute on the lookup context. "rendered_format" is an implementation detail that we shouldn't test directly.
Diffstat (limited to 'actionview/test/actionpack')
-rw-r--r--actionview/test/actionpack/controller/render_test.rb11
1 files changed, 11 insertions, 0 deletions
diff --git a/actionview/test/actionpack/controller/render_test.rb b/actionview/test/actionpack/controller/render_test.rb
index 727d3fbc1a..52c3c54d96 100644
--- a/actionview/test/actionpack/controller/render_test.rb
+++ b/actionview/test/actionpack/controller/render_test.rb
@@ -174,6 +174,10 @@ class TestController < ActionController::Base
render inline: "<%= controller_name %>"
end
+ def inline_rendered_format_without_format
+ render inline: "test"
+ end
+
# :ported:
def render_custom_code
render plain: "hello world", status: 404
@@ -659,6 +663,7 @@ class RenderTest < ActionController::TestCase
get :hello_world_from_rxml_using_action, to: "test#hello_world_from_rxml_using_action"
get :hello_world_from_rxml_using_template, to: "test#hello_world_from_rxml_using_template"
get :hello_world_with_layout_false, to: "test#hello_world_with_layout_false"
+ get :inline_rendered_format_without_format, to: "test#inline_rendered_format_without_format"
get :layout_overriding_layout, to: "test#layout_overriding_layout"
get :layout_test, to: "test#layout_test"
get :layout_test_with_different_layout, to: "test#layout_test_with_different_layout"
@@ -1015,6 +1020,12 @@ class RenderTest < ActionController::TestCase
assert_equal "<wrapper>\n<html>\n <p>Hello </p>\n<p>This is grand!</p>\n</html>\n</wrapper>\n", @response.body
end
+ def test_rendered_format_without_format
+ get :inline_rendered_format_without_format
+ assert_equal "test", @response.body
+ assert_equal "text/html", @response.content_type
+ end
+
def test_partials_list
get :partials_list
assert_equal "goodbyeHello: davidHello: marygoodbye\n", @response.body