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

@@ -56,7 +56,7 @@ module ActiveModel
end
def test_limiting_linked_post_fields
@adapter = ActiveModel::Serializer::Adapter::JsonApi.new(@serializer, include: [:post], fields: { post: [:title] })
@adapter = ActiveModel::Serializer::Adapter::JsonApi.new(@serializer, include: [:post], fields: { post: [:title, :comments, :blog, :author] })
expected = [{
id: '42',
type: 'posts',