|
Lines 38-44
subtest 'list() tests' => sub {
Link Here
|
| 38 |
|
38 |
|
| 39 |
$schema->storage->txn_begin; |
39 |
$schema->storage->txn_begin; |
| 40 |
|
40 |
|
| 41 |
Koha::Patrons->search->delete; |
41 |
Koha::Patrons->search->update( { flags => 0 } ); |
|
|
42 |
$schema->resultset('UserPermission')->delete; |
| 42 |
|
43 |
|
| 43 |
my $librarian = $builder->build_object( |
44 |
my $librarian = $builder->build_object( |
| 44 |
{ |
45 |
{ |
|
Lines 51-58
subtest 'list() tests' => sub {
Link Here
|
| 51 |
$librarian->set_password( { password => $password, skip_validation => 1 } ); |
52 |
$librarian->set_password( { password => $password, skip_validation => 1 } ); |
| 52 |
my $userid = $librarian->userid; |
53 |
my $userid = $librarian->userid; |
| 53 |
|
54 |
|
| 54 |
|
|
|
| 55 |
|
| 56 |
## Authorized user tests |
55 |
## Authorized user tests |
| 57 |
# One erm_user created, should get returned |
56 |
# One erm_user created, should get returned |
| 58 |
$librarian->discard_changes; |
57 |
$librarian->discard_changes; |
|
Lines 85-90
subtest 'list() tests' => sub {
Link Here
|
| 85 |
|
84 |
|
| 86 |
$patron->set_password( { password => $password, skip_validation => 1 } ); |
85 |
$patron->set_password( { password => $password, skip_validation => 1 } ); |
| 87 |
my $unauth_userid = $patron->userid; |
86 |
my $unauth_userid = $patron->userid; |
|
|
87 |
|
| 88 |
# Unauthorized access |
88 |
# Unauthorized access |
| 89 |
$t->get_ok("//$unauth_userid:$password@/api/v1/erm/users")->status_is(403); |
89 |
$t->get_ok("//$unauth_userid:$password@/api/v1/erm/users")->status_is(403); |
| 90 |
|
90 |
|
| 91 |
- |
|
|