Move test to the correct file

上级 df1d21a5
......@@ -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)
......
......@@ -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)
......
......@@ -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
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册