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::System->RoleGroup( 'Cc' );
23 RT::Test->add_rights( { Principal => $Cc, Right => ['ShowTicket'] } );
25 my ($ticket) = RT::Test->create_ticket(
27 Subject => 'test subject',
28 Cc => 'user_a@example.com',
31 my @results = $ticket->Correspond( Content => 'sample correspondence' );
33 ok( $m->login('user_a' => 'password'), 'unprivileged user logged in' );
35 $m->get_ok( '/SelfService/Display.html?id=' . $ticket->id,
36 'got selfservice display page' );
38 my $title = '#' . $ticket->id . ': test subject';
39 $m->title_is( $title );
40 $m->content_contains( "<h1>$title</h1>", "contains <h1>$title</h1>" );
42 # $ShowUnreadMessageNotifications tests:
43 $m->content_contains( "There are unread messages on this ticket." );
45 # mark the message as read
47 { text => 'jump to the first unread message and mark all messages as seen' },
48 'followed mark as seen link'
51 $m->content_contains( "<h1>$title</h1>", "contains <h1>$title</h1>" );
52 $m->content_lacks( "There are unread messages on this ticket." );
54 # TODO need more SelfService tests