aboutsummaryrefslogtreecommitdiffstats
path: root/activemodel/test/cases/serializeration/xml_serialization_test.rb
diff options
context:
space:
mode:
authorJeremy Holland <jeremy@jeremypholland.com>2010-10-31 22:16:55 -0500
committerAaron Patterson <aaron.patterson@gmail.com>2010-11-03 10:43:45 -0700
commitea0faa2055fbbe6ac9ebe960ddf4bea8adda287a (patch)
tree288788e1c0fdcbc744b856ae462aee95c8d6a5c6 /activemodel/test/cases/serializeration/xml_serialization_test.rb
parent208fb2920d6c6c6be97a7086cea24f4c8220010c (diff)
downloadrails-ea0faa2055fbbe6ac9ebe960ddf4bea8adda287a.tar.gz
rails-ea0faa2055fbbe6ac9ebe960ddf4bea8adda287a.tar.bz2
rails-ea0faa2055fbbe6ac9ebe960ddf4bea8adda287a.zip
Allowing to_xml :camelize option to be set to :lower to enable lower-camelcase tags [#5903 state:resolved]
Diffstat (limited to 'activemodel/test/cases/serializeration/xml_serialization_test.rb')
-rw-r--r--activemodel/test/cases/serializeration/xml_serialization_test.rb7
1 files changed, 7 insertions, 0 deletions
diff --git a/activemodel/test/cases/serializeration/xml_serialization_test.rb b/activemodel/test/cases/serializeration/xml_serialization_test.rb
index ff786658b7..cc19d322b3 100644
--- a/activemodel/test/cases/serializeration/xml_serialization_test.rb
+++ b/activemodel/test/cases/serializeration/xml_serialization_test.rb
@@ -70,6 +70,13 @@ class XmlSerializationTest < ActiveModel::TestCase
assert_match %r{<CreatedAt}, @xml
end
+ test "should allow lower-camelized tags" do
+ @xml = @contact.to_xml :root => 'xml_contact', :camelize => :lower
+ assert_match %r{^<xmlContact>}, @xml
+ assert_match %r{</xmlContact>$}, @xml
+ assert_match %r{<createdAt}, @xml
+ end
+
test "should allow skipped types" do
@xml = @contact.to_xml :skip_types => true
assert_match %r{<age>25</age>}, @xml