diff --git a/activerecord/test/cases/attribute_methods_test.rb b/activerecord/test/cases/attribute_methods_test.rb index 4bc68acd1382746ae239b39c615a8429adfa4a80..c043e32a204c3e6e1169df820a095e0164397ca5 100644 --- a/activerecord/test/cases/attribute_methods_test.rb +++ b/activerecord/test/cases/attribute_methods_test.rb @@ -734,6 +734,12 @@ def test_list_of_serialized_attributes assert_equal %w(preferences), Contact.serialized_attributes.keys end + def test_serialized_attributes_are_class_level_settings + topic = Topic.new + assert_raise(NoMethodError) { topic.serialized_attributes = [] } + assert_deprecated { topic.serialized_attributes } + end + def test_instance_method_should_be_defined_on_the_base_class subklass = Class.new(Topic) diff --git a/activerecord/test/cases/base_test.rb b/activerecord/test/cases/base_test.rb index 63981a68a9e829d6efa928ed2fb84c870d56c22e..8915e1aea7afa51b0b9fd96593bfda3c28630ea2 100644 --- a/activerecord/test/cases/base_test.rb +++ b/activerecord/test/cases/base_test.rb @@ -1310,6 +1310,12 @@ def test_serialized_attribute assert_equal(myobj, topic.content) end + def test_serialized_attribute_init_with + topic = Topic.allocate + topic.init_with('attributes' => { 'content' => '--- foo' }) + assert_equal 'foo', topic.content + end + def test_serialized_attribute_in_base_class Topic.serialize("content", Hash) diff --git a/activerecord/test/cases/serialization_test.rb b/activerecord/test/cases/serialization_test.rb index 10d8ccc7119d29cc2943a64e479fbd87f64bf983..25b860878aa8d0317295b47d4fa7baba26b9b771 100644 --- a/activerecord/test/cases/serialization_test.rb +++ b/activerecord/test/cases/serialization_test.rb @@ -18,12 +18,6 @@ def setup } end - def test_serialized_init_with - topic = Topic.allocate - topic.init_with('attributes' => { 'content' => '--- foo' }) - assert_equal 'foo', topic.content - end - def test_serialize_should_be_reversible FORMATS.each do |format| @serialized = Contact.new.send("to_#{format}") @@ -51,10 +45,4 @@ def test_serialize_should_allow_attribute_except_filtering assert_equal @contact_attributes[:awesome], contact.awesome, "For #{format}" end end - - def test_serialized_attributes_are_class_level_settings - topic = Topic.new - assert_raise(NoMethodError) { topic.serialized_attributes = [] } - assert_deprecated { topic.serialized_attributes } - end end