Skip to content
Browse files

Remove XmlSimple dependencies

  • Loading branch information...
1 parent ab8fff2 commit 4073a6d0a2f5926e10f06fe1702db7b1b7a20751 @jeremy jeremy committed Nov 25, 2008
Showing with 4 additions and 5 deletions.
  1. +4 −5 actionpack/test/controller/webservice_test.rb
View
9 actionpack/test/controller/webservice_test.rb
@@ -101,14 +101,13 @@ def test_post_xml_using_a_root_node_named_type
end
def test_post_xml_using_an_attributted_node_named_type
- ActionController::Base.param_parsers[Mime::XML] = Proc.new { |data| XmlSimple.xml_in(data, 'ForceArray' => false) }
+ ActionController::Base.param_parsers[Mime::XML] = Proc.new { |data| Hash.from_xml(data)['request'].with_indifferent_access }
process('POST', 'application/xml', '<request><type type="string">Arial,12</type><z>3</z></request>')
assert_equal 'type, z', @controller.response.body
assert @controller.params.has_key?(:type)
- assert_equal 'string', @controller.params['type']['type']
- assert_equal 'Arial,12', @controller.params['type']['content']
- assert_equal '3', @controller.params['z']
+ assert_equal 'Arial,12', @controller.params['type'], @controller.params.inspect
+ assert_equal '3', @controller.params['z'], @controller.params.inspect
end
def test_register_and_use_yaml
@@ -128,7 +127,7 @@ def test_register_and_use_yaml_as_symbol
end
def test_register_and_use_xml_simple
- ActionController::Base.param_parsers[Mime::XML] = Proc.new { |data| XmlSimple.xml_in(data, 'ForceArray' => false) }
+ ActionController::Base.param_parsers[Mime::XML] = Proc.new { |data| Hash.from_xml(data)['request'].with_indifferent_access }
process('POST', 'application/xml', '<request><summary>content...</summary><title>SimpleXml</title></request>' )
assert_equal 'summary, title', @controller.response.body
assert @controller.params.has_key?(:summary)

0 comments on commit 4073a6d

Please sign in to comment.
Something went wrong with that request. Please try again.