diff options
author | Lawrence Pit <lawrence.pit@gmail.com> | 2010-05-06 21:40:48 +1000 |
---|---|---|
committer | Jeremy Kemper <jeremy@bitsweat.net> | 2010-05-06 20:34:47 -0700 |
commit | 1e1d30715ee75312b41045d2af1c68492ea66a05 (patch) | |
tree | 94a3f064d13aba54d02b6cada630ca84476e77e3 /actionpack/test/dispatch | |
parent | 902861a43ae90032063f4a14a3e8b4b9b9c3ca2f (diff) | |
download | rails-1e1d30715ee75312b41045d2af1c68492ea66a05.tar.gz rails-1e1d30715ee75312b41045d2af1c68492ea66a05.tar.bz2 rails-1e1d30715ee75312b41045d2af1c68492ea66a05.zip |
Fix parsing xml input by ActionDispatch::ParamsParser
[#4437 state:committed]
Signed-off-by: Jeremy Kemper <jeremy@bitsweat.net>
Diffstat (limited to 'actionpack/test/dispatch')
-rw-r--r-- | actionpack/test/dispatch/request/xml_params_parsing_test.rb | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/actionpack/test/dispatch/request/xml_params_parsing_test.rb b/actionpack/test/dispatch/request/xml_params_parsing_test.rb index 488799ac2a..f2ce2c5b93 100644 --- a/actionpack/test/dispatch/request/xml_params_parsing_test.rb +++ b/actionpack/test/dispatch/request/xml_params_parsing_test.rb @@ -16,6 +16,19 @@ class XmlParamsParsingTest < ActionController::IntegrationTest TestController.last_request_parameters = nil end + test "parses a strict rack.input" do + class Linted + def call(env) + bar = env['action_dispatch.request.request_parameters']['foo'] + result = "<ok>#{bar}</ok>" + [200, {"Content-Type" => "application/xml", "Content-Length" => result.length.to_s}, result] + end + end + req = Rack::MockRequest.new(ActionDispatch::ParamsParser.new(Linted.new)) + resp = req.post('/', "CONTENT_TYPE" => "application/xml", :input => "<foo>bar</foo>", :lint => true) + assert_equal "<ok>bar</ok>", resp.body + end + test "parses hash params" do with_test_routing do xml = "<person><name>David</name></person>" |