diff options
author | Jamis Buck <jamis@37signals.com> | 2005-09-01 21:51:27 +0000 |
---|---|---|
committer | Jamis Buck <jamis@37signals.com> | 2005-09-01 21:51:27 +0000 |
commit | e758c2e9db63d8b0a01c659a74e8f1dec22a72d0 (patch) | |
tree | cc713b2d4ac7b751e6c5ad4051b05f0f2ab5f83c /actionpack/test | |
parent | 01af965a3e68f719fe9cfdce36a82ad8901fe7a7 (diff) | |
download | rails-e758c2e9db63d8b0a01c659a74e8f1dec22a72d0.tar.gz rails-e758c2e9db63d8b0a01c659a74e8f1dec22a72d0.tar.bz2 rails-e758c2e9db63d8b0a01c659a74e8f1dec22a72d0.zip |
Yield @content_for_ variables to templates #2058 [Sam Stephenson]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@2094 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'actionpack/test')
-rw-r--r-- | actionpack/test/controller/new_render_test.rb | 9 | ||||
-rw-r--r-- | actionpack/test/fixtures/layouts/yield.rhtml | 2 |
2 files changed, 11 insertions, 0 deletions
diff --git a/actionpack/test/controller/new_render_test.rb b/actionpack/test/controller/new_render_test.rb index 7cb3643db5..7c829e68de 100644 --- a/actionpack/test/controller/new_render_test.rb +++ b/actionpack/test/controller/new_render_test.rb @@ -149,6 +149,10 @@ class NewRenderTestController < ActionController::Base render :text => "foo" end + def yield_content_for + render :action => "content_for", :layout => "yield" + end + def rescue_action(e) raise end private @@ -371,4 +375,9 @@ class NewRenderTest < Test::Unit::TestCase get :render_text_with_assigns assert_equal "world", assigns["hello"] end + + def test_yield_content_for + get :yield_content_for + assert_equal "<title>Putting stuff in the title!</title>\n\nGreat stuff!\n", @response.body + end end diff --git a/actionpack/test/fixtures/layouts/yield.rhtml b/actionpack/test/fixtures/layouts/yield.rhtml new file mode 100644 index 0000000000..482dc9022e --- /dev/null +++ b/actionpack/test/fixtures/layouts/yield.rhtml @@ -0,0 +1,2 @@ +<title><%= yield :title %></title> +<%= yield %> |