aboutsummaryrefslogtreecommitdiffstats
path: root/activemodel/test/cases/serializeration/xml_serialization_test.rb
diff options
context:
space:
mode:
authorAnil Wadghule <anildigital@gmail.com>2010-05-19 16:25:21 +0530
committerJosé Valim <jose.valim@gmail.com>2010-05-19 13:02:13 +0200
commitbdb2871df7fb0a1eeceadb31aaba4d160df508aa (patch)
tree3ec2c0faf19d5c738537402d94a87b412c047aab /activemodel/test/cases/serializeration/xml_serialization_test.rb
parent5573ab2047b07c3de08d40566de8a8fc80a676cf (diff)
downloadrails-bdb2871df7fb0a1eeceadb31aaba4d160df508aa.tar.gz
rails-bdb2871df7fb0a1eeceadb31aaba4d160df508aa.tar.bz2
rails-bdb2871df7fb0a1eeceadb31aaba4d160df508aa.zip
Fix xml serialization test [#4650 state:resolved]
Signed-off-by: José Valim <jose.valim@gmail.com>
Diffstat (limited to 'activemodel/test/cases/serializeration/xml_serialization_test.rb')
-rw-r--r--activemodel/test/cases/serializeration/xml_serialization_test.rb7
1 files changed, 5 insertions, 2 deletions
diff --git a/activemodel/test/cases/serializeration/xml_serialization_test.rb b/activemodel/test/cases/serializeration/xml_serialization_test.rb
index 7b9ef3e21f..ff786658b7 100644
--- a/activemodel/test/cases/serializeration/xml_serialization_test.rb
+++ b/activemodel/test/cases/serializeration/xml_serialization_test.rb
@@ -17,6 +17,9 @@ module Admin
end
end
+class Customer < Struct.new(:name)
+end
+
class XmlSerializationTest < ActiveModel::TestCase
def setup
@contact = Contact.new
@@ -24,7 +27,7 @@ class XmlSerializationTest < ActiveModel::TestCase
@contact.age = 25
@contact.created_at = Time.utc(2006, 8, 1)
@contact.awesome = false
- customer = OpenStruct.new
+ customer = Customer.new
customer.name = "John"
@contact.preferences = customer
end
@@ -104,7 +107,7 @@ class XmlSerializationTest < ActiveModel::TestCase
end
test "should serialize yaml" do
- assert_match %r{<preferences type=\"yaml\">--- !ruby/object:OpenStruct \ntable:\s*:name: John\n</preferences>}, @contact.to_xml
+ assert_match %r{<preferences type=\"yaml\">--- !ruby/struct:Customer \nname: John\n</preferences>}, @contact.to_xml
end
test "should call proc on object" do