diff options
author | Aaron Patterson <aaron.patterson@gmail.com> | 2010-09-07 13:39:27 -0700 |
---|---|---|
committer | Aaron Patterson <aaron.patterson@gmail.com> | 2010-09-07 13:39:27 -0700 |
commit | c6015cbcd8b6ed716c0add2874a17a495250ef0a (patch) | |
tree | 006d88d1b93e70dc652827144d9cb2b67ebeb11a /activerecord/test | |
parent | c8a2dd3caca94ce41f37442512b90343dcbc6161 (diff) | |
download | rails-c6015cbcd8b6ed716c0add2874a17a495250ef0a.tar.gz rails-c6015cbcd8b6ed716c0add2874a17a495250ef0a.tar.bz2 rails-c6015cbcd8b6ed716c0add2874a17a495250ef0a.zip |
serialized attributes should be serialized before validation [#5525 state:resolved]
Diffstat (limited to 'activerecord/test')
-rw-r--r-- | activerecord/test/cases/base_test.rb | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/activerecord/test/cases/base_test.rb b/activerecord/test/cases/base_test.rb index 07b06e15a3..dcb1da7d91 100644 --- a/activerecord/test/cases/base_test.rb +++ b/activerecord/test/cases/base_test.rb @@ -909,9 +909,13 @@ class BasicsTest < ActiveRecord::TestCase MyObject = Struct.new :attribute1, :attribute2 def test_serialized_attribute + Topic.serialize("content", MyObject) + myobj = MyObject.new('value1', 'value2') topic = Topic.create("content" => myobj) - Topic.serialize("content", MyObject) + assert_equal(myobj, topic.content) + + topic.reload assert_equal(myobj, topic.content) end |