Permalink
Browse files

Update Active Model xml serialization test to reflect a change in bui…

…lder

Due to a change in builder, nil values and empty strings now generates
closed tags, so instead of this:

    <pseudonyms nil=\"true\"></pseudonyms>

It generates this:

    <pseudonyms nil=\"true\"/>

Document this change in Rails so that people can track it down easily if
necessary.
  • Loading branch information...
1 parent a203530 commit 0180e090ab6cbe66f7b521a0c03e278a0463accd @carlosantoniodasilva carlosantoniodasilva committed Sep 7, 2012
Showing with 12 additions and 1 deletion.
  1. +11 −0 activemodel/CHANGELOG.md
  2. +1 −1 activemodel/test/cases/serializers/xml_serialization_test.rb
View
@@ -1,5 +1,16 @@
## Rails 4.0.0 (unreleased) ##
+* Due to a change in builder, nil values and empty strings now generates
+ closed tags, so instead of this:
+
+ <pseudonyms nil=\"true\"></pseudonyms>
+
+ It generates this:
+
+ <pseudonyms nil=\"true\"/>
+
+ *Carlos Antonio da Silva*
+
* Changed inclusion and exclusion validators to accept a symbol for `:in` option.
This allows to use dynamic inclusion/exclusion values using methods, besides the current lambda/proc support.
@@ -133,7 +133,7 @@ def setup
end
test "should serialize nil" do
- assert_match %r{<pseudonyms nil=\"true\"></pseudonyms>}, @contact.to_xml(:methods => :pseudonyms)
+ assert_match %r{<pseudonyms nil=\"true\"/>}, @contact.to_xml(:methods => :pseudonyms)
end
test "should serialize integer" do

0 comments on commit 0180e09

Please sign in to comment.