aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/test/controller/render_test.rb
diff options
context:
space:
mode:
Diffstat (limited to 'actionpack/test/controller/render_test.rb')
-rw-r--r--actionpack/test/controller/render_test.rb11
1 files changed, 11 insertions, 0 deletions
diff --git a/actionpack/test/controller/render_test.rb b/actionpack/test/controller/render_test.rb
index afffd15793..e471139d8f 100644
--- a/actionpack/test/controller/render_test.rb
+++ b/actionpack/test/controller/render_test.rb
@@ -59,6 +59,11 @@ class TestController < ActionController::Base
render_action "list"
end
+ def hello_in_a_string
+ @customers = [ Customer.new("david"), Customer.new("mary") ]
+ render_text "How's there? #{render_to_string("test/list")}"
+ end
+
def rescue_action(e) raise end
private
@@ -71,6 +76,7 @@ class TestController < ActionController::Base
end
TestController.template_root = File.dirname(__FILE__) + "/../fixtures/"
+Fun::GamesController.template_root = File.dirname(__FILE__) + "/../fixtures/"
class TestLayoutController < ActionController::Base
layout "layouts/standard"
@@ -175,6 +181,11 @@ class RenderTest < Test::Unit::TestCase
assert_equal "Hello: davidHello: mary", process_request.body
end
+ def test_render_to_string
+ @request.action = "hello_in_a_string"
+ assert_equal "How's there? Hello: davidHello: mary", process_request.body
+ end
+
def test_nested_rendering
@request.action = "hello_world"
assert_equal "Living in a nested world", Fun::GamesController.process(@request, @response).body