Serializers now inherit attributes

This commit is contained in:
Yohan Robert
2015-04-08 16:51:28 +02:00
committed by groyoh
parent 1577969cb7
commit 02ffff599f
4 changed files with 57 additions and 4 deletions

View File

@@ -17,7 +17,13 @@ module ActiveModel
adapter = ActiveModel::Serializer::Adapter::Json.new(@blog_serializer)
assert_equal({:id=>1, :title=>"AMS Hints"}, adapter.serializable_hash)
end
def test_attribute_inheritance_with_key
inherited_klass = Class.new(AlternateBlogSerializer)
blog_serializer = inherited_klass.new(@blog)
adapter = ActiveModel::Serializer::Adapter::Json.new(blog_serializer)
assert_equal({:id=>1, :title=>"AMS Hints"}, adapter.serializable_hash)
end
end
end
end