Skip to content
This repository
Browse code

Remove XmlSimple dependencies

  • Loading branch information...
commit 4073a6d0a2f5926e10f06fe1702db7b1b7a20751 1 parent ab8fff2
Jeremy Kemper jeremy authored

Showing 1 changed file with 4 additions and 5 deletions. Show diff stats Hide diff stats

  1. +4 5 actionpack/test/controller/webservice_test.rb
9 actionpack/test/controller/webservice_test.rb
@@ -101,14 +101,13 @@ def test_post_xml_using_a_root_node_named_type
101 101 end
102 102
103 103 def test_post_xml_using_an_attributted_node_named_type
104   - ActionController::Base.param_parsers[Mime::XML] = Proc.new { |data| XmlSimple.xml_in(data, 'ForceArray' => false) }
  104 + ActionController::Base.param_parsers[Mime::XML] = Proc.new { |data| Hash.from_xml(data)['request'].with_indifferent_access }
105 105 process('POST', 'application/xml', '<request><type type="string">Arial,12</type><z>3</z></request>')
106 106
107 107 assert_equal 'type, z', @controller.response.body
108 108 assert @controller.params.has_key?(:type)
109   - assert_equal 'string', @controller.params['type']['type']
110   - assert_equal 'Arial,12', @controller.params['type']['content']
111   - assert_equal '3', @controller.params['z']
  109 + assert_equal 'Arial,12', @controller.params['type'], @controller.params.inspect
  110 + assert_equal '3', @controller.params['z'], @controller.params.inspect
112 111 end
113 112
114 113 def test_register_and_use_yaml
@@ -128,7 +127,7 @@ def test_register_and_use_yaml_as_symbol
128 127 end
129 128
130 129 def test_register_and_use_xml_simple
131   - ActionController::Base.param_parsers[Mime::XML] = Proc.new { |data| XmlSimple.xml_in(data, 'ForceArray' => false) }
  130 + ActionController::Base.param_parsers[Mime::XML] = Proc.new { |data| Hash.from_xml(data)['request'].with_indifferent_access }
132 131 process('POST', 'application/xml', '<request><summary>content...</summary><title>SimpleXml</title></request>' )
133 132 assert_equal 'summary, title', @controller.response.body
134 133 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.