Lines 405-411
subtest 'delete() tests' => sub {
Link Here
|
405 |
$schema->storage->txn_rollback; |
405 |
$schema->storage->txn_rollback; |
406 |
|
406 |
|
407 |
subtest 'librarian access test' => sub { |
407 |
subtest 'librarian access test' => sub { |
408 |
plan tests => 5; |
408 |
plan tests => 8; |
409 |
|
409 |
|
410 |
$schema->storage->txn_begin; |
410 |
$schema->storage->txn_begin; |
411 |
|
411 |
|
Lines 425-430
subtest 'delete() tests' => sub {
Link Here
|
425 |
|
425 |
|
426 |
my $patron = $builder->build_object({ class => 'Koha::Patrons' }); |
426 |
my $patron = $builder->build_object({ class => 'Koha::Patrons' }); |
427 |
|
427 |
|
|
|
428 |
t::lib::Mocks::mock_preference('AnonymousPatron', $patron->borrowernumber); |
429 |
$t->delete_ok("//$userid:$password@/api/v1/patrons/" . $patron->borrowernumber) |
430 |
->status_is(403, 'Anonymous patron cannot be deleted') |
431 |
->json_is( { error => 'Anonymous patron cannot be deleted' } ); |
432 |
|
433 |
t::lib::Mocks::mock_preference('AnonymousPatron', 0); # back to default |
428 |
$t->delete_ok("//$userid:$password@/api/v1/patrons/" . $patron->borrowernumber) |
434 |
$t->delete_ok("//$userid:$password@/api/v1/patrons/" . $patron->borrowernumber) |
429 |
->status_is(204, 'SWAGGER3.2.4') |
435 |
->status_is(204, 'SWAGGER3.2.4') |
430 |
->content_is('', 'SWAGGER3.3.4'); |
436 |
->content_is('', 'SWAGGER3.3.4'); |
431 |
- |
|
|