diff options
author | Neeraj Singh <neerajdotname@gmail.com> | 2011-01-21 19:13:58 -0500 |
---|---|---|
committer | José Valim <jose.valim@gmail.com> | 2011-01-25 20:14:03 +0100 |
commit | 806e6f80dc7e0abc3c8e139b584bbf444b30d612 (patch) | |
tree | 3f3547983ea41046be7bc46185482c1bdf193c18 /actionpack/test/controller | |
parent | c1145d9281c8deee2a58a96a32f2e3218a7c28be (diff) | |
download | rails-806e6f80dc7e0abc3c8e139b584bbf444b30d612.tar.gz rails-806e6f80dc7e0abc3c8e139b584bbf444b30d612.tar.bz2 rails-806e6f80dc7e0abc3c8e139b584bbf444b30d612.zip |
render_to_string must ensure that response_body
is nil
[ #5875 state:resolved]
Signed-off-by: José Valim <jose.valim@gmail.com>
Diffstat (limited to 'actionpack/test/controller')
-rw-r--r-- | actionpack/test/controller/render_json_test.rb | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/actionpack/test/controller/render_json_test.rb b/actionpack/test/controller/render_json_test.rb index 6dd2a9f23d..fc604a2db3 100644 --- a/actionpack/test/controller/render_json_test.rb +++ b/actionpack/test/controller/render_json_test.rb @@ -26,6 +26,10 @@ class RenderJsonTest < ActionController::TestCase render :json => nil end + def render_json_render_to_string + render :text => render_to_string(:json => '[]') + end + def render_json_hello_world render :json => ActiveSupport::JSON.encode(:hello => 'world') end @@ -76,6 +80,12 @@ class RenderJsonTest < ActionController::TestCase assert_equal 'application/json', @response.content_type end + def test_render_json_render_to_string + get :render_json_render_to_string + assert_equal '[]', @response.body + end + + def test_render_json get :render_json_hello_world assert_equal '{"hello":"world"}', @response.body |