Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

AC:TestCase::Behavior#head only accepts parameters as second argument

  • Loading branch information...
commit 3f38d8442e2c365c6625c647d77f7b31f4da0cd1 1 parent f2494b5
@rafaelfranca rafaelfranca authored
View
2  actionpack/lib/action_controller/test_case.rb
@@ -433,7 +433,7 @@ def process(action, http_method = 'GET', *args)
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
View
4 actionpack/test/controller/test_case_test.rb
@@ -192,6 +192,10 @@ def test_head
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']
Please sign in to comment.
Something went wrong with that request. Please try again.