From b53e33bdc97d9ba82bf97add4005f8cdd44666b9 Mon Sep 17 00:00:00 2001 From: Josef Moravec Date: Fri, 1 Mar 2019 08:40:52 +0000 Subject: [PATCH] Bug 21063: Add more tests --- t/db_dependent/api/v1/illrequests.t | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/t/db_dependent/api/v1/illrequests.t b/t/db_dependent/api/v1/illrequests.t index 59a6bc58d8..d849be93ec 100644 --- a/t/db_dependent/api/v1/illrequests.t +++ b/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( -- 2.11.0