View | Details | Raw Unified | Return to bug 35469
Collapse All | Expand All

(-)a/t/db_dependent/api/v1/checkouts.t (-2 / +24 lines)
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 67-72 $t->get_ok( "//$userid:$password@/api/v1/checkouts?patron_id=$patron_id" ) Link Here
67
67
68
my $notexisting_patron_id = $patron_id + 1;
68
my $notexisting_patron_id = $patron_id + 1;
69
$t->get_ok( "//$userid:$password@/api/v1/checkouts?patron_id=$notexisting_patron_id" )
69
$t->get_ok( "//$userid:$password@/api/v1/checkouts?patron_id=$notexisting_patron_id" )
70
  ->status_is(200, 'manage_bookings allows checkouts access')
71
  ->json_is([]);
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" )
70
  ->status_is(200)
93
  ->status_is(200)
71
  ->json_is([]);
94
  ->json_is([]);
72
95
73
- 

Return to bug 35469