diff options
author | Aaron Patterson <aaron.patterson@gmail.com> | 2011-02-01 15:23:55 -0800 |
---|---|---|
committer | Aaron Patterson <aaron.patterson@gmail.com> | 2011-02-01 15:23:55 -0800 |
commit | 5b42e9660201fc721075d2bfbe13edb0014dbde2 (patch) | |
tree | 73b2d59a35fbceb9676bf5957d408ca0f9149f72 /activerecord/test/cases/serialization_test.rb | |
parent | a0fac7192241f3242af410ca16e6dd43b933c98e (diff) | |
download | rails-5b42e9660201fc721075d2bfbe13edb0014dbde2.tar.gz rails-5b42e9660201fc721075d2bfbe13edb0014dbde2.tar.bz2 rails-5b42e9660201fc721075d2bfbe13edb0014dbde2.zip |
make sure de-serialization happens on object instantiation
Diffstat (limited to 'activerecord/test/cases/serialization_test.rb')
-rw-r--r-- | activerecord/test/cases/serialization_test.rb | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/activerecord/test/cases/serialization_test.rb b/activerecord/test/cases/serialization_test.rb index 25dbcc9fc2..677d659f39 100644 --- a/activerecord/test/cases/serialization_test.rb +++ b/activerecord/test/cases/serialization_test.rb @@ -23,6 +23,12 @@ class SerializationTest < ActiveRecord::TestCase @contact = Contact.new(@contact_attributes) end + def test_serialized_init_with + topic = Topic.allocate + topic.init_with('attributes' => { 'content' => '--- foo' }) + assert_equal 'foo', topic.content + end + def test_to_xml xml = REXML::Document.new(topics(:first).to_xml(:indent => 0)) bonus_time_in_current_timezone = topics(:first).bonus_time.xmlschema |