fix ticketing system error on bootstrap of new install
[freeside.git] / rt / t / web / config_tab_right.t
1 use strict;
2 use warnings;
3
4 use RT::Test nodata => 1, tests => 10;
5
6 my ($uname, $upass, $user) = ('tester', 'tester');
7 {
8     $user = RT::User->new(RT->SystemUser);
9     my ($status, $msg) = $user->Create(
10         Name => $uname,
11         Password => $upass,
12         Disabled => 0,
13         Privileged => 1,
14     );
15     ok($status, 'created a user');
16 }
17
18 my ($baseurl, $m) = RT::Test->started_ok;
19 ok $m->login($uname, $upass), "logged in";
20
21 {
22     $m->content_lacks('li-admin', 'no Admin tab');
23     $m->get('/Admin/');
24     is $m->status, 403, 'no access to /Admin/';
25 }
26
27 RT::Test->set_rights(
28     { Principal => $user->PrincipalObj,
29       Right => [qw(ShowConfigTab)],
30     },
31 );
32
33 {
34     $m->get('/');
35     $m->content_contains('li-admin', 'admin tab is there');
36
37     $m->follow_link_ok({text => 'Admin'});
38     is $m->status, 200, 'user has access to /Admin/';
39 }
40