|
Lines 10-16
use CGI qw ( -utf8 );
Link Here
|
| 10 |
use Test::MockObject; |
10 |
use Test::MockObject; |
| 11 |
use Test::MockModule; |
11 |
use Test::MockModule; |
| 12 |
use List::MoreUtils qw/all any none/; |
12 |
use List::MoreUtils qw/all any none/; |
| 13 |
use Test::More tests => 17; |
13 |
use Test::More tests => 18; |
| 14 |
use Test::Warn; |
14 |
use Test::Warn; |
| 15 |
use t::lib::Mocks; |
15 |
use t::lib::Mocks; |
| 16 |
use t::lib::TestBuilder; |
16 |
use t::lib::TestBuilder; |
|
Lines 857-860
subtest 'create_basic_session tests' => sub {
Link Here
|
| 857 |
is( $session->param('interface'), 'intranet', 'Staff interface gets converted to intranet' ); |
857 |
is( $session->param('interface'), 'intranet', 'Staff interface gets converted to intranet' ); |
| 858 |
}; |
858 |
}; |
| 859 |
|
859 |
|
|
|
860 |
subtest 'can change loggedinlibrary tests' => sub { |
| 861 |
plan tests => 3; |
| 862 |
|
| 863 |
my $superlibrarian = $builder->build( |
| 864 |
{ |
| 865 |
source => 'Borrower', |
| 866 |
value => { |
| 867 |
surname => 'Superlib', |
| 868 |
flags => 1, |
| 869 |
}, |
| 870 |
} |
| 871 |
); |
| 872 |
my $staff1 = $builder->build( |
| 873 |
{ |
| 874 |
source => 'Borrower', |
| 875 |
value => { |
| 876 |
surname => 'Gass', |
| 877 |
flags => 2**29, |
| 878 |
}, |
| 879 |
} |
| 880 |
); |
| 881 |
my $staff2 = $builder->build( |
| 882 |
{ |
| 883 |
source => 'Borrower', |
| 884 |
value => { |
| 885 |
surname => 'Lucas', |
| 886 |
flags => 4, |
| 887 |
}, |
| 888 |
} |
| 889 |
); |
| 890 |
my $r = haspermission( $superlibrarian->{userid} ); |
| 891 |
my $r2 = haspermission( $staff1->{userid} ); |
| 892 |
my $r3 = haspermission( $staff2->{userid} ); |
| 893 |
is( $r->{superlibrarian}, 1, 'Superlibrarian can change branch' ); |
| 894 |
is( $r2->{loggedinlibrary}, 1, 'Staff with loggedinlibrary permission can change branch' ); |
| 895 |
is( $r3->{loggedinlibrary}, 0, 'Staff without loggedinlibrary permmision or superlibrarian cannot change branch' ); |
| 896 |
|
| 897 |
}; |
| 860 |
$schema->storage->txn_rollback; |
898 |
$schema->storage->txn_rollback; |
| 861 |
- |
|
|