4 use RT::Test tests => undef;
6 my ($base, $m) = RT::Test->started_ok;
8 my $user = RT::Test->load_or_create_user(
10 EmailAddress => 'user@example.com',
11 Password => 'password',
15 ok $user->id, 'created user';
19 { Principal => 'privileged', Right => [qw(ModifySelf ShowTicket)] },
21 "granted ModifySelf to privileged"
24 $m->login('ausername');
27 $m->get_ok("$base/Prefs/Other.html");
28 my $style = '../css/base';
31 WebDefaultStylesheet => $style,
35 is(RT->Config->Get('WebDefaultStylesheet', $user), $style, 'set preference');
38 skip "RT::User->Stylesheet wasn't backported", 1 unless $user->can("Stylesheet");
39 is $user->Stylesheet, RT->Config->Get('WebDefaultStylesheet'), '$user->Stylesheet is the default';
43 $m->content_unlike(qr/<link.+?\Q$style\E/, "lack .. path in page <link>");
44 $m->content_contains( RT->Config->Get('WebDefaultStylesheet') );
48 $m->get_ok("$base/Prefs/Other.html");
49 my $format = '/../../m/_elements/full_site_link';
51 form_name => 'ModifyPreferences',
53 UsernameFormat => $format,
57 $m->content_contains('saved');
59 my $ticket = RT::Test->create_ticket(
61 Subject => 'test ticket',
62 Requestor => 'user@example.com',
64 ok $ticket->id, 'created ticket';
65 $m->get_ok($base . "/Ticket/Display.html?id=" . $ticket->id);
66 $m->content_lacks('NotMobile', "lacks NotMobile");
67 $m->next_warning_like(qr/UsernameFormat/, 'caught UsernameFormat warning');
71 $m->get_ok("$base/Helpers/Toggle/ShowRequestor?Status=/../../../Elements/Logo;Requestor=root");
72 $m->content_lacks('logo', "didn't display /Elements/Logo");
73 $m->content_contains('Results.html', "found link to search results");