From bde7cb2cfc266b1591fd53a112d326c7d608c861 Mon Sep 17 00:00:00 2001 From: Kurtis Rainbolt-Greene Date: Sun, 26 Aug 2018 12:44:46 -0700 Subject: [PATCH] Attempting to prove that includes and fields together are broken --- spec/serializer_spec.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/spec/serializer_spec.rb b/spec/serializer_spec.rb index f993dea..d3ec59c 100644 --- a/spec/serializer_spec.rb +++ b/spec/serializer_spec.rb @@ -645,7 +645,7 @@ def read_attribute_for_validation(attr) 'included' => [], }) end - it 'handles include of to-many relationships with compound document' do + it 'handles include of to-many relationships with compound document with sparse fieldset' do long_comments = create_list(:long_comment, 2) post = create(:post, :with_author, long_comments: long_comments) @@ -653,7 +653,7 @@ def read_attribute_for_validation(attr) serializer: MyApp::PostSerializer, include_linkages: ['long-comments'], }) - expect(JSONAPI::Serializer.serialize(post, include: ['long-comments'])).to eq({ + expect(JSONAPI::Serializer.serialize(post, include: ['long-comments'], fields: {posts: ['title']})).to eq({ 'data' => expected_primary_data, 'included' => [ serialize_primary(long_comments.first, {serializer: MyApp::LongCommentSerializer}),