aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/test/cases/xml_serialization_test.rb
diff options
context:
space:
mode:
Diffstat (limited to 'activerecord/test/cases/xml_serialization_test.rb')
-rw-r--r--activerecord/test/cases/xml_serialization_test.rb12
1 files changed, 10 insertions, 2 deletions
diff --git a/activerecord/test/cases/xml_serialization_test.rb b/activerecord/test/cases/xml_serialization_test.rb
index b1c75ec8cd..751946ffc5 100644
--- a/activerecord/test/cases/xml_serialization_test.rb
+++ b/activerecord/test/cases/xml_serialization_test.rb
@@ -79,8 +79,8 @@ class DefaultXmlSerializationTest < ActiveRecord::TestCase
assert_match %r{<awesome type=\"boolean\">false</awesome>}, @xml
end
- def test_should_serialize_yaml
- assert_match %r{<preferences type=\"yaml\">---\s?\n:gem: ruby\n</preferences>}, @xml
+ def test_should_serialize_hash
+ assert_match %r{<preferences>\s*<gem>ruby</gem>\s*</preferences>}m, @xml
end
end
@@ -234,4 +234,12 @@ class DatabaseConnectedXmlSerializationTest < ActiveRecord::TestCase
assert types.include?('StiPost')
end
+ def test_should_produce_xml_for_methods_returning_array
+ xml = authors(:david).to_xml(:methods => :social)
+ array = Hash.from_xml(xml)['author']['social']
+ assert_equal 2, array.size
+ assert array.include? 'twitter'
+ assert array.include? 'github'
+ end
+
end