|
Lines 48-54
subtest 'list() tests' => sub {
Link Here
|
| 48 |
my $another_library = $library->unblessed; # create a copy of $library but make |
48 |
my $another_library = $library->unblessed; # create a copy of $library but make |
| 49 |
delete $another_library->{branchcode}; # sure branchcode will be regenerated |
49 |
delete $another_library->{branchcode}; # sure branchcode will be regenerated |
| 50 |
$another_library = $builder->build_object({ class => 'Koha::Libraries', value => $another_library }); |
50 |
$another_library = $builder->build_object({ class => 'Koha::Libraries', value => $another_library }); |
| 51 |
my ( $borrowernumber, $session_id ) = create_user_and_session( { authorized => 0 } ); |
51 |
my ( $borrowernumber, $session_id ) = create_user_and_session( { authorized => 1 } ); |
| 52 |
|
52 |
|
| 53 |
## Authorized user tests |
53 |
## Authorized user tests |
| 54 |
my $count_of_libraries = Koha::Libraries->search->count; |
54 |
my $count_of_libraries = Koha::Libraries->search->count; |
|
Lines 119-125
subtest 'get() tests' => sub {
Link Here
|
| 119 |
|
119 |
|
| 120 |
my $library = $builder->build_object( { class => 'Koha::Libraries' } ); |
120 |
my $library = $builder->build_object( { class => 'Koha::Libraries' } ); |
| 121 |
my ( $borrowernumber, $session_id ) = |
121 |
my ( $borrowernumber, $session_id ) = |
| 122 |
create_user_and_session( { authorized => 0 } ); |
122 |
create_user_and_session( { authorized => 1 } ); |
| 123 |
|
123 |
|
| 124 |
my $tx = $t->ua->build_tx( GET => "/api/v1/libraries/" . $library->branchcode ); |
124 |
my $tx = $t->ua->build_tx( GET => "/api/v1/libraries/" . $library->branchcode ); |
| 125 |
$tx->req->cookies( { name => 'CGISESSID', value => $session_id } ); |
125 |
$tx->req->cookies( { name => 'CGISESSID', value => $session_id } ); |
| 126 |
- |
|
|