@@ -, +, @@ --- t/db_dependent/api/v1/illrequests.t | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) --- a/t/db_dependent/api/v1/illrequests.t +++ a/t/db_dependent/api/v1/illrequests.t @@ -40,7 +40,7 @@ my $t = Test::Mojo->new('Koha::REST::V1'); subtest 'list() tests' => sub { - plan tests => 18; + plan tests => 20; # Mock ILLBackend (as object) my $backend = Test::MockObject->new; @@ -114,9 +114,11 @@ subtest 'list() tests' => sub { $tx->req->env( { REMOTE_ADDR => $remote_address } ); $t->request_ok($tx)->status_is(200) ->json_has( '/0/patron', 'patron embedded' ) + ->json_is( '/0/patron/patron_id', $patron->borrowernumber, 'The right patron is embeded') ->json_has( '/0/capabilities', 'capabilities embedded' ) ->json_has( '/0/library', 'library embedded' ) - ->json_has( '/0/metadata', 'metadata embedded' ); + ->json_has( '/0/metadata', 'metadata embedded' ) + ->json_hasnt( '/1', 'Only one request was created' ); # Create another ILL request my $illrequest2 = $builder->build_object( --