diff options
author | Rafael Mendonça França <rafaelmfranca@gmail.com> | 2012-01-10 01:57:35 -0300 |
---|---|---|
committer | Rafael Mendonça França <rafaelmfranca@gmail.com> | 2012-01-10 02:01:10 -0300 |
commit | 3f38d8442e2c365c6625c647d77f7b31f4da0cd1 (patch) | |
tree | b3c0cf7318835ace650dba360cc6e09c009e6bd6 /actionpack | |
parent | f2494b536b583c8297a037bc7b636383800fa72f (diff) | |
download | rails-3f38d8442e2c365c6625c647d77f7b31f4da0cd1.tar.gz rails-3f38d8442e2c365c6625c647d77f7b31f4da0cd1.tar.bz2 rails-3f38d8442e2c365c6625c647d77f7b31f4da0cd1.zip |
AC:TestCase::Behavior#head only accepts parameters as second argument
Diffstat (limited to 'actionpack')
-rw-r--r-- | actionpack/lib/action_controller/test_case.rb | 2 | ||||
-rw-r--r-- | actionpack/test/controller/test_case_test.rb | 4 |
2 files changed, 5 insertions, 1 deletions
diff --git a/actionpack/lib/action_controller/test_case.rb b/actionpack/lib/action_controller/test_case.rb index 62770813bd..e9cdb7fbef 100644 --- a/actionpack/lib/action_controller/test_case.rb +++ b/actionpack/lib/action_controller/test_case.rb @@ -433,7 +433,7 @@ module ActionController check_required_ivars http_method, args = handle_old_process_api(http_method, args) - if args.first.is_a?(String) + if args.first.is_a?(String) && http_method != 'HEAD' @request.env['RAW_POST_DATA'] = args.shift end diff --git a/actionpack/test/controller/test_case_test.rb b/actionpack/test/controller/test_case_test.rb index 80e02fd065..34b06df8d8 100644 --- a/actionpack/test/controller/test_case_test.rb +++ b/actionpack/test/controller/test_case_test.rb @@ -192,6 +192,10 @@ XML assert_equal 200, @response.status end + def test_head_params_as_sting + assert_raise(NoMethodError) { head :test_params, "document body", :id => 10 } + end + def test_process_without_flash process :set_flash assert_equal '><', flash['test'] |