aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/test
diff options
context:
space:
mode:
authorMichael Koziarski <michael@koziarski.com>2006-09-17 16:31:30 +0000
committerMichael Koziarski <michael@koziarski.com>2006-09-17 16:31:30 +0000
commit98a412aa3853b9e31b747f53e58a841966df5f1b (patch)
tree37654be64bd05b6d4af1cfd7ac95907dd62a894b /activerecord/test
parent2caf4d5a9337591c2728c7db826526febc5b2158 (diff)
downloadrails-98a412aa3853b9e31b747f53e58a841966df5f1b.tar.gz
rails-98a412aa3853b9e31b747f53e58a841966df5f1b.tar.bz2
rails-98a412aa3853b9e31b747f53e58a841966df5f1b.zip
Add a :namespace option to AR::Base#to_xml [Koz]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@5130 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'activerecord/test')
-rw-r--r--activerecord/test/xml_serialization_test.rb8
1 files changed, 7 insertions, 1 deletions
diff --git a/activerecord/test/xml_serialization_test.rb b/activerecord/test/xml_serialization_test.rb
index 216d582970..2fd9006821 100644
--- a/activerecord/test/xml_serialization_test.rb
+++ b/activerecord/test/xml_serialization_test.rb
@@ -20,7 +20,13 @@ class XmlSerializationTest < Test::Unit::TestCase
assert_match %r{^<contact>}, @xml
assert_match %r{</contact>$}, @xml
end
-
+
+ def test_should_serialize_default_root_with_namespace
+ @xml = Contact.new.to_xml :namespace=>"http://xml.rubyonrails.org/contact"
+ assert_match %r{^<contact xmlns="http://xml.rubyonrails.org/contact">}, @xml
+ assert_match %r{</contact>$}, @xml
+ end
+
def test_should_serialize_custom_root
@xml = Contact.new.to_xml :root => 'xml_contact'
assert_match %r{^<xml-contact>}, @xml