From 97bc74c74611d3d71d58776ed907ebd0cdb98a15 Mon Sep 17 00:00:00 2001 From: Aaron Patterson Date: Wed, 5 Jan 2011 14:03:13 -0800 Subject: make sure new objects can round trip --- activerecord/test/cases/yaml_serialization_test.rb | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'activerecord/test') diff --git a/activerecord/test/cases/yaml_serialization_test.rb b/activerecord/test/cases/yaml_serialization_test.rb index 7503b06126..abcf61ffc0 100644 --- a/activerecord/test/cases/yaml_serialization_test.rb +++ b/activerecord/test/cases/yaml_serialization_test.rb @@ -28,6 +28,12 @@ class YamlSerializationTest < ActiveRecord::TestCase assert_equal topic, t end + def test_psych_roundtrip_new_object + topic = Topic.new + assert topic + t = Psych.load Psych.dump topic + assert_equal topic.attributes, t.attributes + end rescue LoadError end end -- cgit v1.2.3