Fix fields option to restrict relationships as well.

This commit is contained in:
Lucas Hosseini
2015-10-24 20:22:55 +02:00
parent f3403c302c
commit 13ef8fed1b
5 changed files with 96 additions and 4 deletions

View File

@@ -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, :post, :author] })
expected = [{
id: '1',
type: 'comments',