mirror of
https://github.com/github/rails.git
synced 2026-02-05 11:45:13 -05:00
Added a :camelize option to ActiveRecord and Hash to_xml serialization and from_xml deserialization
Signed-off-by: Michael Koziarski <michael@koziarski.com>
This commit is contained in:
committed by
Michael Koziarski
parent
96b815d7e8
commit
aa5cdb0d47
@@ -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"
|
||||
|
||||
Reference in New Issue
Block a user