mirror of
https://github.com/ditkrg/active_model_serializers.git
synced 2026-01-23 06:16:50 +00:00
Merge pull request #798 from donbobka/feature/fix_lost_test
Fix lost test `test_include_multiple_posts_and_linked`
This commit is contained in:
commit
3505bc64a3
@ -44,8 +44,8 @@ module ActiveModel
|
|||||||
@second_comment.post = @first_post
|
@second_comment.post = @first_post
|
||||||
@second_comment.author = nil
|
@second_comment.author = nil
|
||||||
assert_equal([
|
assert_equal([
|
||||||
{ title: "Hello!!", body: "Hello, world!!", id: "1", links: { comments: ['1', '2'], author: "1" } },
|
{ title: "Hello!!", body: "Hello, world!!", id: "1", links: { comments: ['1', '2'], blog: "999", author: "1" } },
|
||||||
{ title: "New Post", body: "Body", id: "2", links: { comments: [], :author => "2" } }
|
{ title: "New Post", body: "Body", id: "2", links: { comments: [], blog: "999", author: "2" } }
|
||||||
], @adapter.serializable_hash[:posts])
|
], @adapter.serializable_hash[:posts])
|
||||||
|
|
||||||
|
|
||||||
@ -69,7 +69,7 @@ module ActiveModel
|
|||||||
id: "1",
|
id: "1",
|
||||||
name: "Steve K.",
|
name: "Steve K.",
|
||||||
links: {
|
links: {
|
||||||
posts: ["1"],
|
posts: ["1", "3"],
|
||||||
roles: [],
|
roles: [],
|
||||||
bio: "1"
|
bio: "1"
|
||||||
}
|
}
|
||||||
@ -99,7 +99,7 @@ module ActiveModel
|
|||||||
assert_equal expected, @adapter.serializable_hash[:linked]
|
assert_equal expected, @adapter.serializable_hash[:linked]
|
||||||
end
|
end
|
||||||
|
|
||||||
def test_include_multiple_posts_and_linked
|
def test_include_bio_and_linked
|
||||||
@serializer = BioSerializer.new(@bio1)
|
@serializer = BioSerializer.new(@bio1)
|
||||||
@adapter = ActiveModel::Serializer::Adapter::JsonApi.new(@serializer, include: 'author,author.posts')
|
@adapter = ActiveModel::Serializer::Adapter::JsonApi.new(@serializer, include: 'author,author.posts')
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user