6 config => 'Set( $ShowUnreadMessageNotifications, 1 );'
9 my ($url, $m) = RT::Test->started_ok;
11 my $user_a = RT::Test->load_or_create_user(
13 Password => 'password',
14 EmailAddress => 'user_a@example.com',
17 ok( $user_a && $user_a->id, 'loaded or created user' );
18 ok( ! $user_a->Privileged, 'user is not privileged' );
21 my $Cc = RT::Group->new( RT->SystemUser );
22 my($ok, $msg) = $Cc->LoadSystemRoleGroup( 'Cc' );
24 RT::Test->add_rights( { Principal => $Cc, Right => ['ShowTicket'] } );
26 my ($ticket) = RT::Test->create_ticket(
28 Subject => 'test subject',
29 Cc => 'user_a@example.com',
32 my @results = $ticket->Correspond( Content => 'sample correspondence' );
34 ok( $m->login('user_a' => 'password'), 'unprivileged user logged in' );
36 $m->get_ok( '/SelfService/Display.html?id=' . $ticket->id,
37 'got selfservice display page' );
39 my $title = '#' . $ticket->id . ': test subject';
40 $m->title_is( $title );
41 $m->content_contains( "<h1>$title</h1>", "contains <h1>$title</h1>" );
43 # $ShowUnreadMessageNotifications tests:
44 $m->content_contains( "There are unread messages on this ticket." );
46 # mark the message as read
48 { text => 'jump to the first unread message and mark all messages as seen' },
49 'followed mark as seen link'
52 $m->content_contains( "<h1>$title</h1>", "contains <h1>$title</h1>" );
53 $m->content_lacks( "There are unread messages on this ticket." );
55 # TODO need more SelfService tests