diff --git a/t/relationships.t b/t/relationships.t index b77ca38..533cd9b 100644 --- a/t/relationships.t +++ b/t/relationships.t @@ -14,7 +14,9 @@ subtest basic => sub { my $s = $registry->serialize( 'thing', { id => 1, - subthings => [ { id => 2, x => 10 }, { id => 3 } ] } ); + subthings => [ { id => 2, x => 10 }, { id => 3 } ] + } + ); ok not $s->{data}{attributes}; @@ -26,21 +28,25 @@ subtest basic => sub { { subthings => { data => [ { id => 2 }, { id => 3 } ] } } }, included => - [ { type => 'subthing', id => 2, attributes => { x => 10 } }, ] }; + [ { type => 'subthing', id => 2, attributes => { x => 10 } }, ] + }; }; subtest "don't repeat includes" => sub { my $s = $registry->serialize( - 'thing', [ - { id => 1, - subthings => [ { id => 2, x => 10 }, { id => 3, y => 20 } ] }, - { id => 2, - subthings => [ { id => 3, y => 20 }, { id => 2, x => 10 } ] } - ] -); + 'thing', + [ + { id => 1, + subthings => [ { id => 2, x => 10 }, { id => 3, y => 20 } ] + }, + { id => 2, + subthings => [ { id => 3, y => 20 }, { id => 2, x => 10 } ] + } + ] + ); - is $s->{ included }->@* + 0, 2; + is $s->{included}->@* + 0, 2; }; done_testing;