Bug 32801: Add tests

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit b157a2cd7f)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
This commit is contained in:
Jonathan Druart 2023-07-05 12:25:40 +02:00 committed by Martin Renvoize
parent 26e4866c9d
commit 4041d06124
No known key found for this signature in database
GPG Key ID: 422B469130441A0F
1 changed files with 7 additions and 1 deletions

View File

@ -17,7 +17,7 @@
use Modern::Perl;
use Test::More tests => 99;
use Test::More tests => 103;
use Test::MockModule;
use Test::Mojo;
use t::lib::Mocks;
@ -125,6 +125,12 @@ $t->get_ok( "//$userid:$password@/api/v1/checkouts?patron_id=$patron_id&checked_
->json_is('/0/item_id' => $item4->itemnumber)
->json_hasnt('/1');
$item4->delete;
$t->get_ok( "//$userid:$password@/api/v1/checkouts?patron_id=$patron_id&checked_in=1" )
->status_is(200)
->json_is('/0/patron_id' => $patron_id)
->json_is('/0/item_id' => undef);
$t->get_ok( "//$unauth_userid:$unauth_password@/api/v1/checkouts/" . $issue3->issue_id )
->status_is(403)
->json_is({ error => "Authorization failure. Missing required permission(s).",