aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport/test/core_ext/hash_ext_test.rb
diff options
context:
space:
mode:
authorJeremy Kemper <jeremy@bitsweat.net>2006-06-29 02:00:44 +0000
committerJeremy Kemper <jeremy@bitsweat.net>2006-06-29 02:00:44 +0000
commit4defe1ac8a1689262a9a9f2c030714727f72e06e (patch)
tree3dd05013bf0a30c0a416e34d57af2146393bd20b /activesupport/test/core_ext/hash_ext_test.rb
parent1fd9a46d713a4b314621bd7cf171bd048b10741f (diff)
downloadrails-4defe1ac8a1689262a9a9f2c030714727f72e06e.tar.gz
rails-4defe1ac8a1689262a9a9f2c030714727f72e06e.tar.bz2
rails-4defe1ac8a1689262a9a9f2c030714727f72e06e.zip
More compatible Hash.create_from_xml. Closes #5523.
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@4510 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'activesupport/test/core_ext/hash_ext_test.rb')
-rw-r--r--activesupport/test/core_ext/hash_ext_test.rb23
1 files changed, 23 insertions, 0 deletions
diff --git a/activesupport/test/core_ext/hash_ext_test.rb b/activesupport/test/core_ext/hash_ext_test.rb
index 65050de15a..bd197a7e4e 100644
--- a/activesupport/test/core_ext/hash_ext_test.rb
+++ b/activesupport/test/core_ext/hash_ext_test.rb
@@ -357,4 +357,27 @@ class HashToXmlTest < Test::Unit::TestCase
assert_equal expected_topic_hash, Hash.create_from_xml(topics_xml)["topics"]["topic"].first
end
+
+ def test_single_record_from_xml_with_attributes_other_than_type
+ topic_xml = <<-EOT
+ <rsp stat="ok">
+ <photos page="1" pages="1" perpage="100" total="16">
+ <photo id="175756086" owner="55569174@N00" secret="0279bf37a1" server="76" title="Colored Pencil PhotoBooth Fun" ispublic="1" isfriend="0" isfamily="0"/>
+ </photos>
+ </rsp>
+ EOT
+
+ expected_topic_hash = {
+ :id => "175756086",
+ :owner => "55569174@N00",
+ :secret => "0279bf37a1",
+ :server => "76",
+ :title => "Colored Pencil PhotoBooth Fun",
+ :ispublic => "1",
+ :isfriend => "0",
+ :isfamily => "0",
+ }.stringify_keys
+
+ assert_equal expected_topic_hash, Hash.create_from_xml(topic_xml)["rsp"]["photos"]["photo"]
+ end
end \ No newline at end of file