|
Lines 40-46
my $tx;
Link Here
|
| 40 |
|
40 |
|
| 41 |
subtest 'under() tests' => sub { |
41 |
subtest 'under() tests' => sub { |
| 42 |
|
42 |
|
| 43 |
plan tests => 20; |
43 |
plan tests => 23; |
| 44 |
|
44 |
|
| 45 |
$schema->storage->txn_begin; |
45 |
$schema->storage->txn_begin; |
| 46 |
|
46 |
|
|
Lines 104-109
subtest 'under() tests' => sub {
Link Here
|
| 104 |
->status_is(503) |
104 |
->status_is(503) |
| 105 |
->json_is('/error', 'System is under maintenance.'); |
105 |
->json_is('/error', 'System is under maintenance.'); |
| 106 |
|
106 |
|
|
|
107 |
# 503 (public while maintenance syspref activated) |
| 108 |
t::lib::Mocks::mock_preference( 'OPACMaintenance', 1 ); |
| 109 |
t::lib::Mocks::mock_preference( 'RESTPublicAPI', 1 ); |
| 110 |
$tx = $t->ua->build_tx( GET => "/api/v1/public/libraries" ); |
| 111 |
$tx->req->env( { REMOTE_ADDR => $remote_address } ); |
| 112 |
$t->request_ok($tx)->status_is(503)->json_is( '/error', 'Under maintenance' ); |
| 113 |
t::lib::Mocks::mock_preference( 'OPACMaintenance', 0 ); |
| 114 |
t::lib::Mocks::mock_preference( 'RESTPublicAPI', 0 ); |
| 115 |
|
| 107 |
$schema->storage->txn_rollback; |
116 |
$schema->storage->txn_rollback; |
| 108 |
}; |
117 |
}; |
| 109 |
|
118 |
|
| 110 |
- |
|
|