diff options
author | Jeremy Kemper <jeremy@bitsweat.net> | 2007-03-18 07:30:09 +0000 |
---|---|---|
committer | Jeremy Kemper <jeremy@bitsweat.net> | 2007-03-18 07:30:09 +0000 |
commit | 27ba5edef1c4264a8d1c0e54675723d37a391dd8 (patch) | |
tree | 83e5292708b2452b26d92f4a95dd6094f298c64e /activesupport/test/core_ext | |
parent | 3202fbabe6df3591d7e2c35727ea9c8b68df8828 (diff) | |
download | rails-27ba5edef1c4264a8d1c0e54675723d37a391dd8.tar.gz rails-27ba5edef1c4264a8d1c0e54675723d37a391dd8.tar.bz2 rails-27ba5edef1c4264a8d1c0e54675723d37a391dd8.zip |
Hash#to_xml supports YAML attributes; ActiveRecord::Base#to_xml support serialized attributes. Closes #7502.
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@6444 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'activesupport/test/core_ext')
-rw-r--r-- | activesupport/test/core_ext/hash_ext_test.rb | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/activesupport/test/core_ext/hash_ext_test.rb b/activesupport/test/core_ext/hash_ext_test.rb index 64d550aaf5..5a5bd7fe5a 100644 --- a/activesupport/test/core_ext/hash_ext_test.rb +++ b/activesupport/test/core_ext/hash_ext_test.rb @@ -376,7 +376,7 @@ class HashToXmlTest < Test::Unit::TestCase <replies-close-in type="integer">2592000000</replies-close-in> <written-on type="date">2003-07-16</written-on> <viewed-at type="datetime">2003-07-16T09:28:00+0000</viewed-at> - <content>Have a nice day</content> + <content type="yaml">--- \n1: should be an integer\n:message: Have a nice day\narray: \n- should-have-dashes: true\n should_have_underscores: true\n</content> <author-email-address>david@loudthinking.com</author-email-address> <parent-id></parent-id> </topic> @@ -391,7 +391,7 @@ class HashToXmlTest < Test::Unit::TestCase :replies_close_in => 2592000000, :written_on => Date.new(2003, 7, 16), :viewed_at => Time.utc(2003, 7, 16, 9, 28), - :content => "Have a nice day", + :content => { :message => "Have a nice day", 1 => "should be an integer", "array" => [{ "should-have-dashes" => true, "should_have_underscores" => true }] }, :author_email_address => "david@loudthinking.com", :parent_id => nil }.stringify_keys @@ -407,6 +407,7 @@ class HashToXmlTest < Test::Unit::TestCase <approved type="boolean"></approved> <written-on type="date"></written-on> <viewed-at type="datetime"></viewed-at> + <content type="yaml"></content> <parent-id></parent-id> </topic> EOT @@ -416,7 +417,8 @@ class HashToXmlTest < Test::Unit::TestCase :id => nil, :approved => nil, :written_on => nil, - :viewed_at => nil, + :viewed_at => nil, + :content => nil, :parent_id => nil }.stringify_keys |