Bug 29806: Regression tests

Signed-off-by: David Nind <david@davidnind.com>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
This commit is contained in:
Tomas Cohen Arazi 2022-01-06 09:27:28 -03:00 committed by Kyle Hall
parent d1ea769c79
commit 652ffefd45
1 changed files with 19 additions and 1 deletions

View File

@ -1066,7 +1066,7 @@ subtest 'edit() tests' => sub {
subtest 'add() tests' => sub {
plan tests => 10;
plan tests => 16;
$schema->storage->txn_begin;
@ -1185,6 +1185,24 @@ subtest 'add() tests' => sub {
$t->post_ok( "//$userid:$password@/api/v1/holds" => json => $item_hold_data )
->status_is(201);
# empty cases
$mock_biblio->mock( 'pickup_locations', sub {
return Koha::Libraries->new->empty;
});
$t->post_ok( "//$userid:$password@/api/v1/holds" => json => $biblio_hold_data )
->status_is(400)
->json_is({ error => 'The supplied pickup location is not valid' });
# empty cases
$mock_item->mock( 'pickup_locations', sub {
return Koha::Libraries->new->empty;
});
$t->post_ok( "//$userid:$password@/api/v1/holds" => json => $item_hold_data )
->status_is(400)
->json_is({ error => 'The supplied pickup location is not valid' });
$schema->storage->txn_rollback;
};