Bugzilla – Attachment 117935 Details for
Bug 27898
Make PUT /holds/:hold_id handle x-koha-override for pickup locations
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 27898: Unit tests
Bug-27898-Unit-tests.patch (text/plain), 2.38 KB, created by
Tomás Cohen Arazi (tcohen)
on 2021-03-08 16:09:33 UTC
(
hide
)
Description:
Bug 27898: Unit tests
Filename:
MIME Type:
Creator:
Tomás Cohen Arazi (tcohen)
Created:
2021-03-08 16:09:33 UTC
Size:
2.38 KB
patch
obsolete
>From a127a2299b1686de73a28af36be8bf52e961daa3 Mon Sep 17 00:00:00 2001 >From: Tomas Cohen Arazi <tomascohen@theke.io> >Date: Mon, 8 Mar 2021 13:03:43 -0300 >Subject: [PATCH] Bug 27898: Unit tests > >This patch adds unit tests for the PUT /holds/:hold_id route so it >accepts the x-koha-override header and is able to override pickup >location constraints. > >Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> >--- > t/db_dependent/api/v1/holds.t | 15 ++++++++++++++- > 1 file changed, 14 insertions(+), 1 deletion(-) > >diff --git a/t/db_dependent/api/v1/holds.t b/t/db_dependent/api/v1/holds.t >index f01d5de427b..56ae481cb8d 100755 >--- a/t/db_dependent/api/v1/holds.t >+++ b/t/db_dependent/api/v1/holds.t >@@ -860,7 +860,7 @@ subtest 'pickup_locations() tests' => sub { > > subtest 'edit() tests' => sub { > >- plan tests => 14; >+ plan tests => 20; > > $schema->storage->txn_begin; > >@@ -885,6 +885,7 @@ subtest 'edit() tests' => sub { > # Disable logging > t::lib::Mocks::mock_preference( 'HoldsLog', 0 ); > t::lib::Mocks::mock_preference( 'RESTBasicAuth', 1 ); >+ t::lib::Mocks::mock_preference( 'AllowHoldPolicyOverride', 1 ); > > my $mock_biblio = Test::MockModule->new('Koha::Biblio'); > my $mock_item = Test::MockModule->new('Koha::Item'); >@@ -930,6 +931,12 @@ subtest 'edit() tests' => sub { > $biblio_hold->discard_changes; > is( $biblio_hold->branchcode, $library_3->branchcode, 'branchcode remains untouched' ); > >+ $t->put_ok( "//$userid:$password@/api/v1/holds/" . $biblio_hold->id >+ => { 'x-koha-override' => 'any' } >+ => json => $biblio_hold_data ) >+ ->status_is(200) >+ ->json_has( '/pickup_library_id' => $library_1->id ); >+ > $biblio_hold_data->{pickup_library_id} = $library_2->branchcode; > $t->put_ok( "//$userid:$password@/api/v1/holds/" > . $biblio_hold->id >@@ -964,6 +971,12 @@ subtest 'edit() tests' => sub { > $item_hold->discard_changes; > is( $item_hold->branchcode, $library_3->branchcode, 'branchcode remains untouched' ); > >+ $t->put_ok( "//$userid:$password@/api/v1/holds/" . $item_hold->id >+ => { 'x-koha-override' => 'any' } >+ => json => $item_hold_data ) >+ ->status_is(200) >+ ->json_has( '/pickup_library_id' => $library_1->id ); >+ > $item_hold_data->{pickup_library_id} = $library_2->branchcode; > $t->put_ok( "//$userid:$password@/api/v1/holds/" > . $item_hold->id >-- >2.30.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 27898
:
117935
|
117936
|
117939
|
117940
|
120268
|
120269