Bugzilla – Attachment 108016 Details for
Bug 26181
Holds placed via the REST API should not be forced by default even if AllowHoldPolicyOverride is enabled
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 26181: regression tests
Bug-26181-regression-tests.patch (text/plain), 2.04 KB, created by
Tomás Cohen Arazi (tcohen)
on 2020-08-10 20:35:09 UTC
(
hide
)
Description:
Bug 26181: regression tests
Filename:
MIME Type:
Creator:
Tomás Cohen Arazi (tcohen)
Created:
2020-08-10 20:35:09 UTC
Size:
2.04 KB
patch
obsolete
>From 20f3262409396755cc09e81a2b8741765294d524 Mon Sep 17 00:00:00 2001 >From: Tomas Cohen Arazi <tomascohen@theke.io> >Date: Mon, 10 Aug 2020 17:30:13 -0300 >Subject: [PATCH] Bug 26181: regression tests > >Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> >--- > t/db_dependent/api/v1/holds.t | 24 ++++++++++++++++-------- > 1 file changed, 16 insertions(+), 8 deletions(-) > >diff --git a/t/db_dependent/api/v1/holds.t b/t/db_dependent/api/v1/holds.t >index f7436da0ee..23ea8f5033 100644 >--- a/t/db_dependent/api/v1/holds.t >+++ b/t/db_dependent/api/v1/holds.t >@@ -17,6 +17,8 @@ > > use Modern::Perl; > >+use Mojo::JSON qw( encode_json ); >+ > use Test::More tests => 8; > use Test::Mojo; > use t::lib::TestBuilder; >@@ -348,16 +350,16 @@ subtest 'test AllowHoldDateInFuture' => sub { > > subtest 'test AllowHoldPolicyOverride' => sub { > >- plan tests => 5; >+ plan tests => 7; > > $dbh->do('DELETE FROM reserves'); > > Koha::CirculationRules->set_rules( > { >- itemtype => undef, >- branchcode => undef, >- rules => { >- holdallowed => 1 >+ itemtype => undef, >+ branchcode => undef, >+ rules => { >+ holdallowed => 1 > } > } > ); >@@ -365,13 +367,19 @@ subtest 'test AllowHoldPolicyOverride' => sub { > t::lib::Mocks::mock_preference( 'AllowHoldPolicyOverride', 0 ); > > $t->post_ok( "//$userid_3:$password@/api/v1/holds" => json => $post_data ) >- ->status_is(403) >- ->json_has('/error'); >+ ->status_is(403)->json_has('/error'); > > t::lib::Mocks::mock_preference( 'AllowHoldPolicyOverride', 1 ); > > $t->post_ok( "//$userid_3:$password@/api/v1/holds" => json => $post_data ) >- ->status_is(201); >+ ->status_is(403); >+ >+ $t->post_ok( >+ "//$userid_3:$password@/api/v1/holds" => { >+ 'x-koha-override' => >+ encode_json( { AllowHoldPolicyOverride => Mojo::JSON->true } ) >+ } => json => $post_data >+ )->status_is(201); > }; > > $schema->storage->txn_rollback; >-- >2.28.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 26181
:
108016
|
108017
|
116720
|
116721
|
116757
|
116758
|
116786
|
116787