Lines 501-507
subtest 'Search by any borrowers field (bug 17374)' => sub {
Link Here
|
501 |
}; |
501 |
}; |
502 |
|
502 |
|
503 |
subtest 'Search with permissions' => sub { |
503 |
subtest 'Search with permissions' => sub { |
504 |
plan tests => 2; |
504 |
plan tests => 4; |
505 |
|
505 |
|
506 |
my $superlibrarian = $builder->build_object( |
506 |
my $superlibrarian = $builder->build_object( |
507 |
{ |
507 |
{ |
Lines 549-554
subtest 'Search with permissions' => sub {
Link Here
|
549 |
], |
549 |
], |
550 |
'We got the 3 patrons we expected' |
550 |
'We got the 3 patrons we expected' |
551 |
); |
551 |
); |
|
|
552 |
|
553 |
C4::Context->dbh->do( |
554 |
q|INSERT INTO user_permissions(borrowernumber, module_bit, code) VALUES(?,?,?)|, |
555 |
undef, |
556 |
$librarian_with_subpermission->borrowernumber, |
557 |
1, |
558 |
'force_checkout' |
559 |
); |
560 |
is( $search_results->{iTotalDisplayRecords}, |
561 |
3, "We find 3 patrons with suggestions_manage permission" ); |
562 |
is_deeply( |
563 |
[ sort map { $_->{borrowernumber} } @{ $search_results->{patrons} } ], |
564 |
[ |
565 |
$superlibrarian->borrowernumber, |
566 |
$librarian_with_full_permission->borrowernumber, |
567 |
$librarian_with_subpermission->borrowernumber |
568 |
], |
569 |
'We got the 3 patrons we expected' |
570 |
); |
571 |
|
552 |
}; |
572 |
}; |
553 |
|
573 |
|
554 |
subtest 'return values' => sub { |
574 |
subtest 'return values' => sub { |
555 |
- |
|
|