Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Test for no layout on nothing

git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@1354 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
  • Loading branch information...
commit c41f0cc720f732c6794118762ac4f7f7f8a0ef48 1 parent bdd16a7
@dhh dhh authored
Showing with 10 additions and 1 deletion.
  1. +10 −1 actionpack/test/controller/new_render_test.rb
View
11 actionpack/test/controller/new_render_test.rb
@@ -58,6 +58,10 @@ def rendering_without_layout
render :action => "hello_world", :layout => false
end
+ def rendering_nothing_on_layout
+ render :nothing => true
+ end
+
def builder_layout_test
render :action => "hello"
end
@@ -85,7 +89,7 @@ def rescue_action(e) raise end
private
def determine_layout
case action_name
- when "layout_test", "rendering_without_layout"
+ when "layout_test", "rendering_without_layout", "rendering_nothing_on_layout"
"layouts/standard"
when "builder_layout_test"
"layouts/builder"
@@ -199,6 +203,11 @@ def test_rendering_without_layout
assert_equal "Hello world!", process_request.body
end
+ def test_rendering_nothing_on_layout
+ @request.action = "rendering_nothing_on_layout"
+ assert_equal "", process_request.body
+ end
+
def test_render_xml_with_layouts
@request.action = "builder_layout_test"
assert_equal "<wrapper>\n<html>\n <p>Hello </p>\n<p>This is grand!</p>\n</html>\n</wrapper>\n", process_request.body
Please sign in to comment.
Something went wrong with that request. Please try again.