diff options
author | José Valim <jose.valim@plataformatec.com.br> | 2012-07-07 00:48:59 -0700 |
---|---|---|
committer | José Valim <jose.valim@plataformatec.com.br> | 2012-07-07 00:48:59 -0700 |
commit | c7779c6fcdf026e50d54f0eaae957d750d8f37f3 (patch) | |
tree | 8591df2cd910a03bb845c6b459b04890ac84372f /activerecord/test/cases | |
parent | 967f5f372009e0a44ba7042708a1b2865ac893e6 (diff) | |
parent | 75322ac5b84198b16ad2202888a620ffec6ca9aa (diff) | |
download | rails-c7779c6fcdf026e50d54f0eaae957d750d8f37f3.tar.gz rails-c7779c6fcdf026e50d54f0eaae957d750d8f37f3.tar.bz2 rails-c7779c6fcdf026e50d54f0eaae957d750d8f37f3.zip |
Merge pull request #6997 from kennyj/fix_stored_attributes
Added *instance_writer: false* to stored/serialized attributes.
Diffstat (limited to 'activerecord/test/cases')
-rw-r--r-- | activerecord/test/cases/serialization_test.rb | 7 | ||||
-rw-r--r-- | activerecord/test/cases/store_test.rb | 7 |
2 files changed, 14 insertions, 0 deletions
diff --git a/activerecord/test/cases/serialization_test.rb b/activerecord/test/cases/serialization_test.rb index a4c065e667..ce167509c1 100644 --- a/activerecord/test/cases/serialization_test.rb +++ b/activerecord/test/cases/serialization_test.rb @@ -51,4 +51,11 @@ class SerializationTest < ActiveRecord::TestCase assert_equal @contact_attributes[:awesome], contact.awesome, "For #{format}" end end + + def test_serialized_attributes_are_class_level_settings + assert_raise NoMethodError do + topic = Topic.new + topic.serialized_attributes = [] + end + end end diff --git a/activerecord/test/cases/store_test.rb b/activerecord/test/cases/store_test.rb index 7f2b8945f9..3e60b62fd5 100644 --- a/activerecord/test/cases/store_test.rb +++ b/activerecord/test/cases/store_test.rb @@ -120,4 +120,11 @@ class StoreTest < ActiveRecord::TestCase test "stored attributes are returned" do assert_equal [:color, :homepage], Admin::User.stored_attributes[:settings] end + + test "stores_attributes are class level settings" do + assert_raise NoMethodError do + @john.stored_attributes = {} + end + end + end |