mirror of
https://github.com/ditkrg/active_model_serializers.git
synced 2026-01-25 07:16:49 +00:00
Spec for linked resource type name demodulization
This commit is contained in:
@@ -78,10 +78,15 @@ module ActiveModel
|
||||
assert_nil adapter.serializable_hash[:linked]
|
||||
end
|
||||
|
||||
def test_include_type_for_association_when_is_different_than_name
|
||||
def test_include_type_for_association_when_different_than_name
|
||||
serializer = BlogSerializer.new(@blog)
|
||||
adapter = ActiveModel::Serializer::Adapter::JsonApi.new(serializer)
|
||||
assert_equal({type: "posts", ids: ["1"]}, adapter.serializable_hash[:blogs][:links][:articles])
|
||||
actual = adapter.serializable_hash[:blogs][:links][:articles]
|
||||
expected = {
|
||||
type: "posts",
|
||||
ids: ["1"]
|
||||
}
|
||||
assert_equal(expected, actual)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user