Bugzilla – Attachment 120268 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.50 KB, created by
Nick Clemens (kidclamp)
on 2021-04-28 12:19:32 UTC
(
hide
)
Description:
Bug 27898: Unit tests
Filename:
MIME Type:
Creator:
Nick Clemens (kidclamp)
Created:
2021-04-28 12:19:32 UTC
Size:
2.50 KB
patch
obsolete
>From 340941c8218c6d1cf800be063794ccd37ea3a1c6 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> > >Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com> > >Signed-off-by: Nick Clemens <nick@bywatersolutions.com> >--- > 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 e44a0d14fe..e754fed632 100755 >--- a/t/db_dependent/api/v1/holds.t >+++ b/t/db_dependent/api/v1/holds.t >@@ -893,7 +893,7 @@ subtest 'pickup_locations() tests' => sub { > > subtest 'edit() tests' => sub { > >- plan tests => 14; >+ plan tests => 20; > > $schema->storage->txn_begin; > >@@ -918,6 +918,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'); >@@ -963,6 +964,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 >@@ -997,6 +1004,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.11.0
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