add fields to adapter initialize function, pull in master, add tests using includes with fields

This commit is contained in:
Aaron Renoir
2014-11-05 18:10:37 -08:00
parent c9c58e31e5
commit fc1562c04a
7 changed files with 31 additions and 63 deletions

View File

@@ -25,6 +25,15 @@ module ActiveModel
{ title: "New Post", body: "Body", id: "2", links: { comments: [], author: "1" } }
], @adapter.serializable_hash[:posts])
end
def test_limiting_fields
@adapter = ActiveModel::Serializer::Adapter::JsonApi.new(@serializer, fields: ['title'])
assert_equal([
{ title: "Hello!!", links: { comments: [], author: "1" } },
{ title: "New Post", links: { comments: [], author: "1" } }
], @adapter.serializable_hash[:posts])
end
end
end
end