aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport/test/core_ext/hash_ext_test.rb
diff options
context:
space:
mode:
authorJosh Franklin <contact@sentaidigital.com>2010-03-26 12:43:59 +0100
committerJosé Valim <jose.valim@gmail.com>2010-03-26 12:44:12 +0100
commitc7cc9583689d63d342983d739ccf5c4e94233a48 (patch)
tree8094fd1816e900b675ccd50d89de16c8df4ac71a /activesupport/test/core_ext/hash_ext_test.rb
parent4c7c4061558bb8781da0d54159e3cebcb0a8c07a (diff)
downloadrails-c7cc9583689d63d342983d739ccf5c4e94233a48.tar.gz
rails-c7cc9583689d63d342983d739ccf5c4e94233a48.tar.bz2
rails-c7cc9583689d63d342983d739ccf5c4e94233a48.zip
Add support for a type=binary with an optional encoding=base64. If the encoding attribute is absent, the data is considered unencoded.
[#2966 state:resolved]
Diffstat (limited to 'activesupport/test/core_ext/hash_ext_test.rb')
-rw-r--r--activesupport/test/core_ext/hash_ext_test.rb4
1 files changed, 3 insertions, 1 deletions
diff --git a/activesupport/test/core_ext/hash_ext_test.rb b/activesupport/test/core_ext/hash_ext_test.rb
index 5b1d53ac7b..86272a28c1 100644
--- a/activesupport/test/core_ext/hash_ext_test.rb
+++ b/activesupport/test/core_ext/hash_ext_test.rb
@@ -757,6 +757,7 @@ class HashToXmlTest < Test::Unit::TestCase
<expires-at type="dateTime">2007-12-25T12:34:56+0000</expires-at>
<notes type="string"></notes>
<illustration type="base64Binary">YmFiZS5wbmc=</illustration>
+ <caption type="binary" encoding="base64">VGhhdCdsbCBkbywgcGlnLg==</caption>
</bacon>
EOT
@@ -766,7 +767,8 @@ class HashToXmlTest < Test::Unit::TestCase
:price => BigDecimal("12.50"),
:expires_at => Time.utc(2007,12,25,12,34,56),
:notes => "",
- :illustration => "babe.png"
+ :illustration => "babe.png",
+ :caption => "That'll do, pig."
}.stringify_keys
assert_equal expected_bacon_hash, Hash.from_xml(bacon_xml)["bacon"]