diff options
author | Joshua Wehner <joshua.wehner@gmail.com> | 2011-03-03 15:43:42 -0500 |
---|---|---|
committer | Joshua Wehner <joshua.wehner@gmail.com> | 2011-05-10 12:06:09 -0400 |
commit | 2cef2d411a20b89b71fb76876c33b331f94d0cc5 (patch) | |
tree | be87688daa4b431f01e1e05051fa764408341bfc /activemodel/test/cases/serializers | |
parent | 8e55afb453beb8f98d647ae97619101b19b7f911 (diff) | |
download | rails-2cef2d411a20b89b71fb76876c33b331f94d0cc5.tar.gz rails-2cef2d411a20b89b71fb76876c33b331f94d0cc5.tar.bz2 rails-2cef2d411a20b89b71fb76876c33b331f94d0cc5.zip |
Methods that return nil should not be considered YAML
Diffstat (limited to 'activemodel/test/cases/serializers')
-rw-r--r-- | activemodel/test/cases/serializers/xml_serialization_test.rb | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/activemodel/test/cases/serializers/xml_serialization_test.rb b/activemodel/test/cases/serializers/xml_serialization_test.rb index b6a2f88667..8f5c196850 100644 --- a/activemodel/test/cases/serializers/xml_serialization_test.rb +++ b/activemodel/test/cases/serializers/xml_serialization_test.rb @@ -92,6 +92,10 @@ class XmlSerializationTest < ActiveModel::TestCase test "should serialize string" do assert_match %r{<name>aaron stack</name>}, @contact.to_xml end + + test "should serialize nil" do + assert_match %r{<pseudonyms nil=\"true\"></pseudonyms>}, @contact.to_xml(:methods => :pseudonyms) + end test "should serialize integer" do assert_match %r{<age type="integer">25</age>}, @contact.to_xml |