aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/test/controller/new_render_test.rb
diff options
context:
space:
mode:
authorDavid Heinemeier Hansson <david@loudthinking.com>2008-01-03 15:28:36 +0000
committerDavid Heinemeier Hansson <david@loudthinking.com>2008-01-03 15:28:36 +0000
commitd5645fd4a0b8160646e69273626a77badd9ab1a4 (patch)
tree5759f8c4f78632c77f997cf3370911d53ba464de /actionpack/test/controller/new_render_test.rb
parent7b8ee2438f95f41d0770b110cdab3253832b1848 (diff)
downloadrails-d5645fd4a0b8160646e69273626a77badd9ab1a4.tar.gz
rails-d5645fd4a0b8160646e69273626a77badd9ab1a4.tar.bz2
rails-d5645fd4a0b8160646e69273626a77badd9ab1a4.zip
Fixed rendering of partials with layout when done from site layout (closes #9209) [antramm]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8541 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'actionpack/test/controller/new_render_test.rb')
-rw-r--r--actionpack/test/controller/new_render_test.rb27
1 files changed, 25 insertions, 2 deletions
diff --git a/actionpack/test/controller/new_render_test.rb b/actionpack/test/controller/new_render_test.rb
index 4c0b9d0c9c..d8364a6a0b 100644
--- a/actionpack/test/controller/new_render_test.rb
+++ b/actionpack/test/controller/new_render_test.rb
@@ -361,10 +361,18 @@ class NewRenderTestController < ActionController::Base
render :action => "calling_partial_with_layout"
end
+ def render_call_to_partial_with_layout_in_main_layout_and_within_content_for_layout
+ render :action => "calling_partial_with_layout"
+ end
+
def render_using_layout_around_block
render :action => "using_layout_around_block"
end
+ def render_using_layout_around_block_in_main_layout_and_within_content_for_layout
+ render :action => "using_layout_around_block"
+ end
+
def rescue_action(e) raise end
private
@@ -387,6 +395,10 @@ class NewRenderTestController < ActionController::Base
"layouts/builder"
when "action_talk_to_layout", "layout_overriding_layout"
"layouts/talk_from_action"
+ when "render_call_to_partial_with_layout_in_main_layout_and_within_content_for_layout"
+ "layouts/partial_with_layout"
+ when "render_using_layout_around_block_in_main_layout_and_within_content_for_layout"
+ "layouts/block_with_layout"
end
end
end
@@ -825,9 +837,20 @@ EOS
get :render_call_to_partial_with_layout
assert_equal "Before (David)\nInside from partial (David)\nAfter", @response.body
end
-
+
+ def test_render_call_to_partial_with_layout_in_main_layout_and_within_content_for_layout
+ get :render_call_to_partial_with_layout_in_main_layout_and_within_content_for_layout
+ assert_equal "Before (Anthony)\nInside from partial (Anthony)\nAfter\nBefore (David)\nInside from partial (David)\nAfter\nBefore (Ramm)\nInside from partial (Ramm)\nAfter", @response.body
+ end
+
def test_using_layout_around_block
- get :using_layout_around_block
+ get :render_using_layout_around_block
assert_equal "Before (David)\nInside from block\nAfter", @response.body
end
+
+ def test_using_layout_around_block_in_main_layout_and_within_content_for_layout
+ get :render_using_layout_around_block_in_main_layout_and_within_content_for_layout
+ assert_equal "Before (Anthony)\nInside from first block in layout\nAfter\nBefore (David)\nInside from block\nAfter\nBefore (Ramm)\nInside from second block in layout\nAfter\n", @response.body
+ end
+
end