aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/test/xml_serialization_test.rb
diff options
context:
space:
mode:
authorTobias Lütke <tobias.luetke@gmail.com>2007-07-09 19:10:45 +0000
committerTobias Lütke <tobias.luetke@gmail.com>2007-07-09 19:10:45 +0000
commit5b2be6293443a4c25aab7cf3e74fc84cb70e2199 (patch)
treedd465a436b172c779ddd0b557d1160a79489e022 /activerecord/test/xml_serialization_test.rb
parent049b1440a392ac53a427fecd4500bb839e090be4 (diff)
downloadrails-5b2be6293443a4c25aab7cf3e74fc84cb70e2199.tar.gz
rails-5b2be6293443a4c25aab7cf3e74fc84cb70e2199.tar.bz2
rails-5b2be6293443a4c25aab7cf3e74fc84cb70e2199.zip
Make [7169] work as expected with indented XML.
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@7171 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
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