Bug 39781: (RM follow-up) Fix wrong mock_userenv key in test
mock_userenv expects 'branchcode' but the test was passing 'branch',
causing the branchcode to fall through to the 'Branch4T' default and
the branch-specific notice lookup to never match.
Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk>
(cherry picked from commit b0df04264e)
Signed-off-by: Jacob O'Mara <Jacob.omara@openfifth.co.uk>
This commit is contained in:
parent
fa67c646a9
commit
9cd18e379b
|
|
@ -90,15 +90,15 @@ subtest 'GetByModuleForLibrary' => sub {
|
|||
$builder->build(
|
||||
{ source => 'Letter', value => { module => 'add_message', code => 'MSG_BRANCH1', branchcode => $branch1 } } );
|
||||
|
||||
t::lib::Mocks::mock_userenv( { branch => $branch1 } );
|
||||
t::lib::Mocks::mock_userenv( { branchcode => $branch1 } );
|
||||
$notices = $plugin->GetByModuleForLibrary('add_message');
|
||||
is( scalar @$notices, 2, 'user at branch1 sees all-libraries and branch-specific notices' );
|
||||
|
||||
t::lib::Mocks::mock_userenv( { branch => $branch2 } );
|
||||
t::lib::Mocks::mock_userenv( { branchcode => $branch2 } );
|
||||
$notices = $plugin->GetByModuleForLibrary('add_message');
|
||||
is( scalar @$notices, 1, 'user at branch2 sees only all-libraries notices' );
|
||||
|
||||
t::lib::Mocks::mock_userenv( { branch => '' } );
|
||||
t::lib::Mocks::mock_userenv( { branchcode => $branch2 } );
|
||||
$notices = $plugin->GetByModuleForLibrary('add_message');
|
||||
is( scalar @$notices, 1, 'user with no branch sees only all-libraries notices' );
|
||||
};
|
||||
|
|
|
|||
Loading…
Reference in New Issue