diff options
Diffstat (limited to 'actionpack/test/controller/test_test.rb')
-rw-r--r-- | actionpack/test/controller/test_test.rb | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/actionpack/test/controller/test_test.rb b/actionpack/test/controller/test_test.rb index ec30f0ac8b..d786a05feb 100644 --- a/actionpack/test/controller/test_test.rb +++ b/actionpack/test/controller/test_test.rb @@ -13,6 +13,10 @@ class TestTest < Test::Unit::TestCase render :text => request.raw_post end + def render_body + render :text => request.body.read + end + def test_params render :text => params.inspect end @@ -93,8 +97,15 @@ HTML params = {:page => {:name => 'page name'}, 'some key' => 123} get :render_raw_post, params.dup - raw_post = params.map {|k,v| [CGI::escape(k.to_s), CGI::escape(v.to_s)].join('=')}.sort.join('&') - assert_equal raw_post, @response.body + assert_equal params.to_query, @response.body + end + + def test_body_stream + params = { :page => { :name => 'page name' }, 'some key' => 123 } + + get :render_body, params.dup + + assert_equal params.to_query, @response.body end def test_process_without_flash |