diff options
author | Bruce Krysiak <bruce@socialpl.us> | 2008-12-08 16:38:04 -0800 |
---|---|---|
committer | Michael Koziarski <michael@koziarski.com> | 2008-12-10 20:28:05 +0100 |
commit | aa5cdb0d47fb5484bfdde8244df7efeb2175bf3a (patch) | |
tree | b0b0309c7f6e700c70e2fbbe3185724479a7434f /activerecord/test/cases | |
parent | 96b815d7e81b9cef912ef94c96dca923fe43b0ba (diff) | |
download | rails-aa5cdb0d47fb5484bfdde8244df7efeb2175bf3a.tar.gz rails-aa5cdb0d47fb5484bfdde8244df7efeb2175bf3a.tar.bz2 rails-aa5cdb0d47fb5484bfdde8244df7efeb2175bf3a.zip |
Added a :camelize option to ActiveRecord and Hash to_xml serialization and from_xml deserialization
Signed-off-by: Michael Koziarski <michael@koziarski.com>
Diffstat (limited to 'activerecord/test/cases')
-rw-r--r-- | activerecord/test/cases/xml_serialization_test.rb | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/activerecord/test/cases/xml_serialization_test.rb b/activerecord/test/cases/xml_serialization_test.rb index 63f48865cc..39c6ea820d 100644 --- a/activerecord/test/cases/xml_serialization_test.rb +++ b/activerecord/test/cases/xml_serialization_test.rb @@ -31,6 +31,13 @@ class XmlSerializationTest < ActiveRecord::TestCase assert_match %r{<created_at}, @xml end + def test_should_allow_camelized_tags + @xml = Contact.new.to_xml :root => 'xml_contact', :camelize => true + assert_match %r{^<XmlContact>}, @xml + assert_match %r{</XmlContact>$}, @xml + assert_match %r{<CreatedAt}, @xml + end + def test_should_include_yielded_additions @xml = Contact.new.to_xml do |xml| xml.creator "David" |