aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/test/xml_serialization_test.rb
diff options
context:
space:
mode:
Diffstat (limited to 'activerecord/test/xml_serialization_test.rb')
-rw-r--r--activerecord/test/xml_serialization_test.rb5
1 files changed, 3 insertions, 2 deletions
diff --git a/activerecord/test/xml_serialization_test.rb b/activerecord/test/xml_serialization_test.rb
index 824f486d2e..807daddabb 100644
--- a/activerecord/test/xml_serialization_test.rb
+++ b/activerecord/test/xml_serialization_test.rb
@@ -165,9 +165,10 @@ class DatabaseConnectedXmlSerializationTest < Test::Unit::TestCase
def test_should_include_empty_has_many_as_empty_array
authors(:david).posts.delete_all
- xml = authors(:david).to_xml :include=>:posts, :indent => 0
+ xml = authors(:david).to_xml :include=>:posts, :indent => 2
- assert_match %r{<posts type="array"></posts>}, xml
+ assert_equal [], Hash.from_xml(xml)['author']['posts']
+ assert_match %r{^ <posts type="array"/>}, xml
end
end \ No newline at end of file