Lines 45-52
subtest 'list() tests' => sub {
Link Here
|
45 |
$schema->storage->txn_begin; |
45 |
$schema->storage->txn_begin; |
46 |
|
46 |
|
47 |
Koha::Cities->search->delete; |
47 |
Koha::Cities->search->delete; |
48 |
my ( $borrowernumber, $session_id ) = |
48 |
my ( $borrowernumber, $session_id ) = create_user_and_session({ authorized => 1 }); |
49 |
create_user_and_session( { authorized => 0 } ); |
|
|
50 |
|
49 |
|
51 |
## Authorized user tests |
50 |
## Authorized user tests |
52 |
# No cities, so empty array should be returned |
51 |
# No cities, so empty array should be returned |
Lines 116-122
subtest 'get() tests' => sub {
Link Here
|
116 |
$schema->storage->txn_begin; |
115 |
$schema->storage->txn_begin; |
117 |
|
116 |
|
118 |
my $city = $builder->build_object({ class => 'Koha::Cities' }); |
117 |
my $city = $builder->build_object({ class => 'Koha::Cities' }); |
119 |
my ( $borrowernumber, $session_id ) = create_user_and_session({ authorized => 0 }); |
118 |
my ( $borrowernumber, $session_id ) = create_user_and_session({ authorized => 1 }); |
120 |
|
119 |
|
121 |
my $tx = $t->ua->build_tx( GET => "/api/v1/cities/" . $city->id ); |
120 |
my $tx = $t->ua->build_tx( GET => "/api/v1/cities/" . $city->id ); |
122 |
$tx->req->cookies({ name => 'CGISESSID', value => $session_id }); |
121 |
$tx->req->cookies({ name => 'CGISESSID', value => $session_id }); |
123 |
- |
|
|