add Admin text test
This commit is contained in:
parent
fab9f722e8
commit
3e1cfcccbe
1 changed files with 10 additions and 1 deletions
11
t/Macro.t
11
t/Macro.t
|
|
@ -59,24 +59,33 @@ foreach my $macro ( @settingMacros ) {
|
||||||
|
|
||||||
use Test::More; # increment this value for each test you create
|
use Test::More; # increment this value for each test you create
|
||||||
|
|
||||||
my $numTests = 4 + $settingMacros;
|
my $numTests = 6 + $settingMacros;
|
||||||
|
|
||||||
plan tests => $numTests;
|
plan tests => $numTests;
|
||||||
|
|
||||||
diag("Planning on running $numTests tests\n");
|
diag("Planning on running $numTests tests\n");
|
||||||
|
|
||||||
my $macroText = "^GroupText(3,local,foreigner);";
|
my $macroText = "^GroupText(3,local,foreigner);";
|
||||||
|
my $AdminText = "^AdminText(admin);";
|
||||||
my $output;
|
my $output;
|
||||||
|
|
||||||
$output = $macroText;
|
$output = $macroText;
|
||||||
WebGUI::Macro::process($session, \$output);
|
WebGUI::Macro::process($session, \$output);
|
||||||
is($output, 'foreigner', 'GroupText, user not in group');
|
is($output, 'foreigner', 'GroupText, user not in group');
|
||||||
|
|
||||||
|
$output = $adminText;
|
||||||
|
WebGUI::Macro::process($session, \$output);
|
||||||
|
is($output, '', 'AdminText, user not in group');
|
||||||
|
|
||||||
$output = $macroText;
|
$output = $macroText;
|
||||||
$session->user({userId => 3});
|
$session->user({userId => 3});
|
||||||
WebGUI::Macro::process($session, \$output);
|
WebGUI::Macro::process($session, \$output);
|
||||||
is($output, 'local', 'GroupText, user in group');
|
is($output, 'local', 'GroupText, user in group');
|
||||||
|
|
||||||
|
$output = $adminText;
|
||||||
|
WebGUI::Macro::process($session, \$output);
|
||||||
|
is($output, 'admin', 'AdminText, user is admin');
|
||||||
|
|
||||||
my $apText = "^AssetProxy(getting_started);";
|
my $apText = "^AssetProxy(getting_started);";
|
||||||
WebGUI::Macro::process($session, \$apText);
|
WebGUI::Macro::process($session, \$apText);
|
||||||
my $apPass = like($output, qr/If you're reading this/, 'AssetProxy functional check');
|
my $apPass = like($output, qr/If you're reading this/, 'AssetProxy functional check');
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue