aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport/test/core_ext/hash_ext_test.rb
diff options
context:
space:
mode:
Diffstat (limited to 'activesupport/test/core_ext/hash_ext_test.rb')
-rw-r--r--activesupport/test/core_ext/hash_ext_test.rb7
1 files changed, 5 insertions, 2 deletions
diff --git a/activesupport/test/core_ext/hash_ext_test.rb b/activesupport/test/core_ext/hash_ext_test.rb
index 359eacaba3..fe728919cd 100644
--- a/activesupport/test/core_ext/hash_ext_test.rb
+++ b/activesupport/test/core_ext/hash_ext_test.rb
@@ -336,13 +336,14 @@ class HashToXmlTest < Test::Unit::TestCase
end
def test_one_level_with_types
- xml = { :name => "David", :street => "Paulina", :age => 26, :age_in_millis => 820497600000, :moved_on => Date.new(2005, 11, 15) }.to_xml(@xml_options)
+ xml = { :name => "David", :street => "Paulina", :age => 26, :age_in_millis => 820497600000, :moved_on => Date.new(2005, 11, 15), :resident => :yes }.to_xml(@xml_options)
assert_equal "<person>", xml.first(8)
assert xml.include?(%(<street>Paulina</street>))
assert xml.include?(%(<name>David</name>))
assert xml.include?(%(<age type="integer">26</age>))
assert xml.include?(%(<age-in-millis type="integer">820497600000</age-in-millis>))
assert xml.include?(%(<moved-on type="date">2005-11-15</moved-on>))
+ assert xml.include?(%(<resident type="symbol">yes</resident>))
end
def test_one_level_with_nils
@@ -416,6 +417,7 @@ class HashToXmlTest < Test::Unit::TestCase
<parent-id></parent-id>
<ad-revenue type="decimal">1.5</ad-revenue>
<optimum-viewing-angle type="float">135</optimum-viewing-angle>
+ <resident type="symbol">yes</resident>
</topic>
EOT
@@ -432,7 +434,8 @@ class HashToXmlTest < Test::Unit::TestCase
:author_email_address => "david@loudthinking.com",
:parent_id => nil,
:ad_revenue => BigDecimal("1.50"),
- :optimum_viewing_angle => 135.0
+ :optimum_viewing_angle => 135.0,
+ :resident => :yes
}.stringify_keys
assert_equal expected_topic_hash, Hash.from_xml(topic_xml)["topic"]