Bugzilla – Attachment 129411 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.50 KB, created by
Tomás Cohen Arazi (tcohen)
on 2022-01-13 15:16:12 UTC
(
hide
)
Description:
Bug 29877: Regression tests
Filename:
MIME Type:
Creator:
Tomás Cohen Arazi (tcohen)
Created:
2022-01-13 15:16:12 UTC
Size:
1.50 KB
patch
obsolete
>From b17c5a32ae7f92c7a85e22d2658419ba2ddcb8e5 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> >--- > 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.34.1
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