Skip to content

Commit 88785ea

Browse files
committed
Add failing test.
1 parent aaa60bf commit 88785ea

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

test/adapter/json/collection_test.rb

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,16 @@ def test_root_is_underscored
7575

7676
assert_equal 1, adapter.serializable_hash[:virtual_values].length
7777
end
78+
79+
def test_include_option
80+
serializer = ArraySerializer.new([@first_post, @second_post])
81+
adapter = ActiveModel::Serializer::Adapter::Json.new(serializer, include: '')
82+
actual = adapter.serializable_hash
83+
expected = { posts: [{ id: 1, title: 'Hello!!', body: 'Hello, world!!' },
84+
{ id: 2, title: 'New Post', body: 'Body' }] }
85+
86+
assert_equal(expected, actual)
87+
end
7888
end
7989
end
8090
end

0 commit comments

Comments
 (0)