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> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> (cherry picked from commit8ea1b883b7) Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com> (cherry picked from commit998e0997e4) Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
This commit is contained in:
parent
b5bcdaf2cb
commit
2fa43197c1
|
|
@ -596,7 +596,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;
|
||||
|
||||
|
|
@ -682,6 +682,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