|
Lines 292-298
subtest 'delete() tests' => sub {
Link Here
|
| 292 |
|
292 |
|
| 293 |
subtest 'get_public() tests' => sub { |
293 |
subtest 'get_public() tests' => sub { |
| 294 |
|
294 |
|
| 295 |
plan tests => 25; |
295 |
plan tests => 26; |
| 296 |
|
296 |
|
| 297 |
$schema->storage->txn_begin; |
297 |
$schema->storage->txn_begin; |
| 298 |
|
298 |
|
|
Lines 425-430
subtest 'get_public() tests' => sub {
Link Here
|
| 425 |
t::lib::Mocks::mock_preference('OpacHiddenItems'); |
425 |
t::lib::Mocks::mock_preference('OpacHiddenItems'); |
| 426 |
}; |
426 |
}; |
| 427 |
|
427 |
|
|
|
428 |
subtest 'OpacSuppression tests' => sub { |
| 429 |
|
| 430 |
plan tests => 8; |
| 431 |
|
| 432 |
# Test with OpacSuppression enabled and biblio suppressed |
| 433 |
t::lib::Mocks::mock_preference( 'OpacSuppression', 1 ); |
| 434 |
$biblio->set( { opac_suppressed => 1 } )->store; |
| 435 |
|
| 436 |
$t->get_ok( "/api/v1/public/biblios/" . $biblio->biblionumber => { Accept => 'text/plain' } ) |
| 437 |
->status_is( 404, 'OpacSuppression enabled + opac_suppressed => hidden' ); |
| 438 |
|
| 439 |
# Test with OpacSuppression enabled but biblio not suppressed |
| 440 |
$biblio->set( { opac_suppressed => 0 } )->store; |
| 441 |
$t->get_ok( "/api/v1/public/biblios/" . $biblio->biblionumber => { Accept => 'text/plain' } ) |
| 442 |
->status_is( 200, 'OpacSuppression enabled + not suppressed => displayed' ); |
| 443 |
|
| 444 |
# Test with OpacSuppression disabled but biblio suppressed |
| 445 |
t::lib::Mocks::mock_preference( 'OpacSuppression', 0 ); |
| 446 |
$biblio->set( { opac_suppressed => 1 } )->store; |
| 447 |
$t->get_ok( "/api/v1/public/biblios/" . $biblio->biblionumber => { Accept => 'text/plain' } ) |
| 448 |
->status_is( 200, 'OpacSuppression disabled + opac_suppressed => displayed' ); |
| 449 |
|
| 450 |
# Test with both disabled |
| 451 |
$biblio->set( { opac_suppressed => 0 } )->store; |
| 452 |
$t->get_ok( "/api/v1/public/biblios/" . $biblio->biblionumber => { Accept => 'text/plain' } ) |
| 453 |
->status_is( 200, 'OpacSuppression disabled + not suppressed => displayed' ); |
| 454 |
}; |
| 455 |
|
| 428 |
$biblio->delete; |
456 |
$biblio->delete; |
| 429 |
$t->get_ok( |
457 |
$t->get_ok( |
| 430 |
"//$userid:$password@/api/v1/public/biblios/" . $biblio->biblionumber => { Accept => 'application/marc' } ) |
458 |
"//$userid:$password@/api/v1/public/biblios/" . $biblio->biblionumber => { Accept => 'application/marc' } ) |
| 431 |
- |
|
|