diff options
Diffstat (limited to 'actionpack/test/controller')
-rw-r--r-- | actionpack/test/controller/render_test.rb | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/actionpack/test/controller/render_test.rb b/actionpack/test/controller/render_test.rb index 2f4cc5a615..78a4e8ccbb 100644 --- a/actionpack/test/controller/render_test.rb +++ b/actionpack/test/controller/render_test.rb @@ -313,6 +313,10 @@ class TestController < ActionController::Base def render_implicit_js_template_without_layout end + def render_html_explicit_template_and_layout + render :template => 'test/render_implicit_html_template_from_xhr_request', :layout => 'layouts/default_html' + end + def formatted_html_erb end @@ -720,6 +724,8 @@ class TestController < ActionController::Base "delete_with_js", "update_page", "update_page_with_instance_variables" "layouts/standard" + when "render_implicit_js_template_without_layout" + "layouts/default_html" when "action_talk_to_layout", "layout_overriding_layout" "layouts/talk_from_action" when "render_implicit_html_template_from_xhr_request" @@ -817,6 +823,11 @@ class RenderTest < ActionController::TestCase assert_equal "<html>hello world, I'm here!</html>", @response.body end + def test_xhr_with_render_text_and_layout + xhr :get, :render_text_hello_world_with_layout + assert_equal "<html>hello world, I'm here!</html>", @response.body + end + def test_do_with_render_action_and_layout_false get :hello_world_with_layout_false assert_equal 'Hello world!', @response.body @@ -1056,6 +1067,11 @@ class RenderTest < ActionController::TestCase assert_equal "XHR!\nHello HTML!", @response.body end + def test_should_render_explicit_html_template_with_html_layout + xhr :get, :render_html_explicit_template_and_layout + assert_equal "<html>Hello HTML!</html>\n", @response.body + end + def test_should_implicitly_render_js_template_without_layout get :render_implicit_js_template_without_layout, :format => :js assert_no_match /<html>/, @response.body |