Bugzilla – Attachment 129415 Details for
Bug 29877
MaxReserves should be enforced consistently between staff interface and API
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 29877: Regression tests
Bug-29877-Regression-tests.patch (text/plain), 1.56 KB, created by
Andrew Fuerste-Henry
on 2022-01-13 16:10:52 UTC
(
hide
)
Description:
Bug 29877: Regression tests
Filename:
MIME Type:
Creator:
Andrew Fuerste-Henry
Created:
2022-01-13 16:10:52 UTC
Size:
1.56 KB
patch
obsolete
>From 855cbdd7037bbe2a94099a27d57f5a77d414cab7 Mon Sep 17 00:00:00 2001 >From: Tomas Cohen Arazi <tomascohen@theke.io> >Date: Thu, 13 Jan 2022 12:10:24 -0300 >Subject: [PATCH] Bug 29877: Regression tests > >Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> > >Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com> >--- > t/db_dependent/api/v1/holds.t | 16 +++++++++++++++- > 1 file changed, 15 insertions(+), 1 deletion(-) > >diff --git a/t/db_dependent/api/v1/holds.t b/t/db_dependent/api/v1/holds.t >index 006c61659a..fc24aca588 100755 >--- a/t/db_dependent/api/v1/holds.t >+++ b/t/db_dependent/api/v1/holds.t >@@ -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; > }; > >-- >2.30.2
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 29877
:
129411
|
129412
|
129415
|
129416
|
131189
|
131190