|
Lines 651-657
subtest 'PUT /holds/{hold_id}/priority tests' => sub {
Link Here
|
| 651 |
|
651 |
|
| 652 |
subtest 'add() tests (maxreserves behaviour)' => sub { |
652 |
subtest 'add() tests (maxreserves behaviour)' => sub { |
| 653 |
|
653 |
|
| 654 |
plan tests => 7; |
654 |
plan tests => 11; |
| 655 |
|
655 |
|
| 656 |
$schema->storage->txn_begin; |
656 |
$schema->storage->txn_begin; |
| 657 |
|
657 |
|
|
Lines 737-742
subtest 'add() tests (maxreserves behaviour)' => sub {
Link Here
|
| 737 |
->status_is(403) |
737 |
->status_is(403) |
| 738 |
->json_is( { error => 'Hold cannot be placed. Reason: tooManyReserves' } ); |
738 |
->json_is( { error => 'Hold cannot be placed. Reason: tooManyReserves' } ); |
| 739 |
|
739 |
|
|
|
740 |
t::lib::Mocks::mock_preference( 'maxreserves', 0 ); |
| 741 |
|
| 742 |
$t->post_ok( "//$userid:$password@/api/v1/holds" => json => $post_data ) |
| 743 |
->status_is(201, 'maxreserves == 0 => no limit'); |
| 744 |
|
| 745 |
# cleanup for the next tests |
| 746 |
my $hold_id = $t->tx->res->json->{hold_id}; |
| 747 |
Koha::Holds->find( $hold_id )->delete; |
| 748 |
|
| 749 |
t::lib::Mocks::mock_preference( 'maxreserves', undef ); |
| 750 |
|
| 751 |
$t->post_ok( "//$userid:$password@/api/v1/holds" => json => $post_data ) |
| 752 |
->status_is(201, 'maxreserves == undef => no limit'); |
| 753 |
|
| 740 |
$schema->storage->txn_rollback; |
754 |
$schema->storage->txn_rollback; |
| 741 |
}; |
755 |
}; |
| 742 |
|
756 |
|
| 743 |
- |
|
|