Bug 29877: Regression tests
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
This commit is contained in:
parent
e55914a5d0
commit
3ce1b0b707
|
|
@ -651,7 +651,7 @@ subtest 'PUT /holds/{hold_id}/priority tests' => sub {
|
|||
|
||||
subtest 'add() tests (maxreserves behaviour)' => sub {
|
||||
|
||||
plan tests => 7;
|
||||
plan tests => 11;
|
||||
|
||||
$schema->storage->txn_begin;
|
||||
|
||||
|
|
@ -737,6 +737,20 @@ subtest 'add() tests (maxreserves behaviour)' => sub {
|
|||
->status_is(403)
|
||||
->json_is( { error => 'Hold cannot be placed. Reason: tooManyReserves' } );
|
||||
|
||||
t::lib::Mocks::mock_preference( 'maxreserves', 0 );
|
||||
|
||||
$t->post_ok( "//$userid:$password@/api/v1/holds" => json => $post_data )
|
||||
->status_is(201, 'maxreserves == 0 => no limit');
|
||||
|
||||
# cleanup for the next tests
|
||||
my $hold_id = $t->tx->res->json->{hold_id};
|
||||
Koha::Holds->find( $hold_id )->delete;
|
||||
|
||||
t::lib::Mocks::mock_preference( 'maxreserves', undef );
|
||||
|
||||
$t->post_ok( "//$userid:$password@/api/v1/holds" => json => $post_data )
|
||||
->status_is(201, 'maxreserves == undef => no limit');
|
||||
|
||||
$schema->storage->txn_rollback;
|
||||
};
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue