Extended format for JSONAPI include option.

This commit is contained in:
Lucas Hosseini
2015-09-10 01:20:39 +02:00
parent b594d1487b
commit ce7a839f3d
12 changed files with 159 additions and 56 deletions

View File

@@ -42,7 +42,7 @@ module ActiveModel
end
def test_includes_linked_comments
@adapter = ActiveModel::Serializer::Adapter::JsonApi.new(@serializer, include: 'comments')
@adapter = ActiveModel::Serializer::Adapter::JsonApi.new(@serializer, include: [:comments])
expected = [{
id: '1',
type: 'comments',
@@ -68,7 +68,7 @@ module ActiveModel
end
def test_limit_fields_of_linked_comments
@adapter = ActiveModel::Serializer::Adapter::JsonApi.new(@serializer, include: 'comments', fields: { comment: [:id] })
@adapter = ActiveModel::Serializer::Adapter::JsonApi.new(@serializer, include: [:comments], fields: { comment: [:id] })
expected = [{
id: '1',
type: 'comments',