Bugzilla – Attachment 160829 Details for
Bug 34999
REST API: Public routes should respect OPACMaintenance
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 34999: Add unit test
Bug-34999-Add-unit-test.patch (text/plain), 1.48 KB, created by
Marcel de Rooy
on 2024-01-11 10:43:35 UTC
(
hide
)
Description:
Bug 34999: Add unit test
Filename:
MIME Type:
Creator:
Marcel de Rooy
Created:
2024-01-11 10:43:35 UTC
Size:
1.48 KB
patch
obsolete
>From 4ab4b9e901f5263988308e564095ea59a6d2e342 Mon Sep 17 00:00:00 2001 >From: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> >Date: Thu, 11 Jan 2024 10:09:57 +0000 >Subject: [PATCH] Bug 34999: Add unit test >Content-Type: text/plain; charset=utf-8 > >Test plan: >Run t/db_dependent/api/v1/auth.t >[Bonus] Run prove t/db_dependent/api/v1 > >Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> >--- > t/db_dependent/api/v1/auth.t | 11 ++++++++++- > 1 file changed, 10 insertions(+), 1 deletion(-) > >diff --git a/t/db_dependent/api/v1/auth.t b/t/db_dependent/api/v1/auth.t >index cdb171925c..5d4f827f58 100755 >--- a/t/db_dependent/api/v1/auth.t >+++ b/t/db_dependent/api/v1/auth.t >@@ -40,7 +40,7 @@ my $tx; > > subtest 'under() tests' => sub { > >- plan tests => 20; >+ plan tests => 23; > > $schema->storage->txn_begin; > >@@ -104,6 +104,15 @@ subtest 'under() tests' => sub { > ->status_is(503) > ->json_is('/error', 'System is under maintenance.'); > >+ # 503 (public while maintenance syspref activated) >+ t::lib::Mocks::mock_preference( 'OPACMaintenance', 1 ); >+ t::lib::Mocks::mock_preference( 'RESTPublicAPI', 1 ); >+ $tx = $t->ua->build_tx( GET => "/api/v1/public/libraries" ); >+ $tx->req->env( { REMOTE_ADDR => $remote_address } ); >+ $t->request_ok($tx)->status_is(503)->json_is( '/error', 'Under maintenance' ); >+ t::lib::Mocks::mock_preference( 'OPACMaintenance', 0 ); >+ t::lib::Mocks::mock_preference( 'RESTPublicAPI', 0 ); >+ > $schema->storage->txn_rollback; > }; > >-- >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 34999
:
159234
|
159235
|
160828
|
160829
|
160840
|
160841
|
160973
|
160974