Lines 1066-1072
subtest 'edit() tests' => sub {
Link Here
|
1066 |
|
1066 |
|
1067 |
subtest 'add() tests' => sub { |
1067 |
subtest 'add() tests' => sub { |
1068 |
|
1068 |
|
1069 |
plan tests => 10; |
1069 |
plan tests => 16; |
1070 |
|
1070 |
|
1071 |
$schema->storage->txn_begin; |
1071 |
$schema->storage->txn_begin; |
1072 |
|
1072 |
|
Lines 1185-1190
subtest 'add() tests' => sub {
Link Here
|
1185 |
$t->post_ok( "//$userid:$password@/api/v1/holds" => json => $item_hold_data ) |
1185 |
$t->post_ok( "//$userid:$password@/api/v1/holds" => json => $item_hold_data ) |
1186 |
->status_is(201); |
1186 |
->status_is(201); |
1187 |
|
1187 |
|
|
|
1188 |
# empty cases |
1189 |
$mock_biblio->mock( 'pickup_locations', sub { |
1190 |
return Koha::Libraries->new->empty; |
1191 |
}); |
1192 |
|
1193 |
$t->post_ok( "//$userid:$password@/api/v1/holds" => json => $biblio_hold_data ) |
1194 |
->status_is(400) |
1195 |
->json_is({ error => 'The supplied pickup location is not valid' }); |
1196 |
|
1197 |
# empty cases |
1198 |
$mock_item->mock( 'pickup_locations', sub { |
1199 |
return Koha::Libraries->new->empty; |
1200 |
}); |
1201 |
|
1202 |
$t->post_ok( "//$userid:$password@/api/v1/holds" => json => $item_hold_data ) |
1203 |
->status_is(400) |
1204 |
->json_is({ error => 'The supplied pickup location is not valid' }); |
1205 |
|
1188 |
$schema->storage->txn_rollback; |
1206 |
$schema->storage->txn_rollback; |
1189 |
}; |
1207 |
}; |
1190 |
|
1208 |
|
1191 |
- |
|
|