add a test

This commit is contained in:
Yanick Champoux 2023-11-13 10:00:55 -05:00
parent 8e5df8fbf0
commit 67c4d58b9d

View File

@ -20,8 +20,8 @@ subtest basic => sub {
ok not $s->{data}{attributes}; ok not $s->{data}{attributes};
like $s, like $s => {
{ data => { data => {
id => 1, id => 1,
type => 'thing', type => 'thing',
relationships => relationships =>
@ -29,7 +29,7 @@ subtest basic => sub {
}, },
included => included =>
[ { type => 'subthing', id => 2, attributes => { x => 10 } }, ] [ { type => 'subthing', id => 2, attributes => { x => 10 } }, ]
}; };
}; };
@ -38,10 +38,24 @@ subtest "don't repeat includes" => sub {
'thing', 'thing',
[ [
{ id => 1, { id => 1,
subthings => [ { id => 2, x => 10 }, { id => 3, y => 20 } ] subthings => [
{ id => 2,
x => 10
},
{ id => 3,
y => 20
}
]
}, },
{ id => 2, { id => 2,
subthings => [ { id => 3, y => 20 }, { id => 2, x => 10 } ] subthings => [
{ id => 3,
y => 20
},
{ id => 2,
x => 10
}
]
} }
] ]
); );