diff options
author | Jeremy Kemper <jeremy@bitsweat.net> | 2009-04-21 16:02:30 -0700 |
---|---|---|
committer | Jeremy Kemper <jeremy@bitsweat.net> | 2009-04-21 16:02:30 -0700 |
commit | f49e3441280380ec810d54bd5a77a7e699415efb (patch) | |
tree | 6d5578830513259a3a3df0d7480f2a1d3b46cacc /actionpack/test | |
parent | 504d16ccdfcd689eac31c1646957b06cc0ce55d1 (diff) | |
download | rails-f49e3441280380ec810d54bd5a77a7e699415efb.tar.gz rails-f49e3441280380ec810d54bd5a77a7e699415efb.tar.bz2 rails-f49e3441280380ec810d54bd5a77a7e699415efb.zip |
Reinstate Base#render_to_string. Introduce AbstractController#render_to_string which stringifies render_to_body.
Diffstat (limited to 'actionpack/test')
-rw-r--r-- | actionpack/test/abstract_controller/abstract_controller_test.rb | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/actionpack/test/abstract_controller/abstract_controller_test.rb b/actionpack/test/abstract_controller/abstract_controller_test.rb index 8763ded57e..918062c7db 100644 --- a/actionpack/test/abstract_controller/abstract_controller_test.rb +++ b/actionpack/test/abstract_controller/abstract_controller_test.rb @@ -56,6 +56,14 @@ module AbstractController def naked_render render end + + def rendering_to_body + render_to_body "naked_render.erb" + end + + def rendering_to_string + render_to_string "naked_render.erb" + end end class TestRenderer < ActiveSupport::TestCase @@ -73,6 +81,16 @@ module AbstractController result = Me2.process(:naked_render) assert_equal "Hello from naked_render.erb", result.response_obj[:body] end + + test "rendering to a rack body" do + result = Me2.process(:rendering_to_body) + assert_equal "Hello from naked_render.erb", result.response_obj[:body] + end + + test "rendering to a string" do + result = Me2.process(:rendering_to_string) + assert_equal "Hello from naked_render.erb", result.response_obj[:body] + end end # Test rendering with prefixes |