aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/test/controller
diff options
context:
space:
mode:
authorMatt Jones <al2o3cr@gmail.com>2009-03-07 13:32:46 -0600
committerJoshua Peek <josh@joshpeek.com>2009-03-07 13:32:46 -0600
commit87e8b162463f13bd50d27398f020769460a770e3 (patch)
treeb96a155293658297c16c95a0a9555ab0c018c338 /actionpack/test/controller
parent77f7d98e38dddf72890c80b4e4b2e088bb76d111 (diff)
downloadrails-87e8b162463f13bd50d27398f020769460a770e3.tar.gz
rails-87e8b162463f13bd50d27398f020769460a770e3.tar.bz2
rails-87e8b162463f13bd50d27398f020769460a770e3.zip
fix HTML fallback for explicit templates [#2052 state:resolved]
Signed-off-by: Joshua Peek <josh@joshpeek.com>
Diffstat (limited to 'actionpack/test/controller')
-rw-r--r--actionpack/test/controller/render_test.rb16
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