Bugzilla – Attachment 157424 Details for
Bug 35053
Item-level rules not checked if both item_id and biblio_id are passed
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 35053: Regression tests
Bug-35053-Regression-tests.patch (text/plain), 2.39 KB, created by
Nick Clemens (kidclamp)
on 2023-10-19 11:57:25 UTC
(
hide
)
Description:
Bug 35053: Regression tests
Filename:
MIME Type:
Creator:
Nick Clemens (kidclamp)
Created:
2023-10-19 11:57:25 UTC
Size:
2.39 KB
patch
obsolete
>From 9c09bbefb2d99b6d9010a6cb3b9869e2f6a53eeb Mon Sep 17 00:00:00 2001 >From: Tomas Cohen Arazi <tomascohen@theke.io> >Date: Tue, 17 Oct 2023 09:03:33 -0300 >Subject: [PATCH] Bug 35053: Regression tests > >Signed-off-by: David Nind <david@davidnind.com> >Signed-off-by: Nick Clemens <nick@bywatersolutions.com> >--- > t/db_dependent/api/v1/holds.t | 32 ++++++++++++++++++++++++-------- > 1 file changed, 24 insertions(+), 8 deletions(-) > >diff --git a/t/db_dependent/api/v1/holds.t b/t/db_dependent/api/v1/holds.t >index 245e5e6a09..37294869b5 100755 >--- a/t/db_dependent/api/v1/holds.t >+++ b/t/db_dependent/api/v1/holds.t >@@ -1097,7 +1097,7 @@ subtest 'edit() tests' => sub { > > subtest 'add() tests' => sub { > >- plan tests => 21; >+ plan tests => 24; > > $schema->storage->txn_begin; > >@@ -1139,17 +1139,22 @@ subtest 'add() tests' => sub { > return Koha::Libraries->search( { branchcode => [ $library_2->branchcode, $library_3->branchcode ] } ); > }); > >- my $can_be_reserved = 'OK'; >+ my $can_biblio_be_reserved = 'OK'; >+ my $can_item_be_reserved = 'OK'; >+ > my $mock_reserves = Test::MockModule->new('C4::Reserves'); >- $mock_reserves->mock( 'CanItemBeReserved', sub >- { >- return { status => $can_be_reserved } >+ >+ $mock_reserves->mock( >+ 'CanItemBeReserved', >+ sub { >+ return { status => $can_item_be_reserved }; > } > > ); >- $mock_reserves->mock( 'CanBookBeReserved', sub >- { >- return { status => $can_be_reserved } >+ $mock_reserves->mock( >+ 'CanBookBeReserved', >+ sub { >+ return { status => $can_biblio_be_reserved }; > } > > ); >@@ -1243,7 +1248,18 @@ subtest 'add() tests' => sub { > ->status_is(400) > ->json_is({ error => 'The supplied pickup location is not valid' }); > >+ $can_item_be_reserved = 'notReservable'; >+ $can_biblio_be_reserved = 'OK'; >+ > $item_hold_data->{pickup_library_id} = $library_2->branchcode; >+ >+ $t->post_ok( "//$userid:$password@/api/v1/holds" => json => $item_hold_data ) >+ ->status_is(403, 'Item checks performed when both biblio_id and item_id passed (Bug 35053)') >+ ->json_is({ error => 'Hold cannot be placed. Reason: notReservable' }); >+ >+ $can_item_be_reserved = 'OK'; >+ $can_biblio_be_reserved = 'OK'; >+ > $t->post_ok( "//$userid:$password@/api/v1/holds" => json => $item_hold_data ) > ->status_is(201); > >-- >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 35053
:
157231
|
157232
|
157389
|
157390
| 157424 |
157425