|
Lines 17-23
Link Here
|
| 17 |
|
17 |
|
| 18 |
use Modern::Perl; |
18 |
use Modern::Perl; |
| 19 |
|
19 |
|
| 20 |
use Test::More tests => 105; |
20 |
use Test::More tests => 108; |
| 21 |
use Test::MockModule; |
21 |
use Test::MockModule; |
| 22 |
use Test::Mojo; |
22 |
use Test::Mojo; |
| 23 |
use t::lib::Mocks; |
23 |
use t::lib::Mocks; |
|
Lines 70-75
$t->get_ok( "//$userid:$password@/api/v1/checkouts?patron_id=$notexisting_patron
Link Here
|
| 70 |
->status_is(200) |
70 |
->status_is(200) |
| 71 |
->json_is([]); |
71 |
->json_is([]); |
| 72 |
|
72 |
|
|
|
73 |
my $bookings_librarian = $builder->build_object( |
| 74 |
{ |
| 75 |
class => 'Koha::Patrons', |
| 76 |
value => { flags => 0 } # no additional permissions |
| 77 |
} |
| 78 |
); |
| 79 |
$builder->build( |
| 80 |
{ |
| 81 |
source => 'UserPermission', |
| 82 |
value => { |
| 83 |
borrowernumber => $bookings_librarian->borrowernumber, |
| 84 |
module_bit => 1, |
| 85 |
code => 'manage_bookings', |
| 86 |
}, |
| 87 |
} |
| 88 |
); |
| 89 |
$bookings_librarian->set_password( { password => $password, skip_validation => 1 } ); |
| 90 |
my $bookings_userid = $bookings_librarian->userid; |
| 91 |
|
| 92 |
$t->get_ok("//$bookings_userid:$password@/api/v1/checkouts?patron_id=$patron_id") |
| 93 |
->status_is( 200, 'manage_bookings allows checkouts access' )->json_is( [] ); |
| 94 |
|
| 73 |
Koha::CirculationRules->set_rules( |
95 |
Koha::CirculationRules->set_rules( |
| 74 |
{ |
96 |
{ |
| 75 |
categorycode => undef, |
97 |
categorycode => undef, |
| 76 |
- |
|
|