X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=rt%2Ft%2Fweb%2Fticket_seen.t;h=e40782f6a49758a31ab3dfa1fb45b454ac6b01c3;hb=679854b8bbc65d112071111bbd7f34a6a481fb30;hp=3a77a5899efe1ad4e6bd18df6efe8e9a9626795a;hpb=fc6209f398899f0211cfcedeb81a3cd65e04a941;p=freeside.git diff --git a/rt/t/web/ticket_seen.t b/rt/t/web/ticket_seen.t index 3a77a5899..e40782f6a 100644 --- a/rt/t/web/ticket_seen.t +++ b/rt/t/web/ticket_seen.t @@ -1,9 +1,8 @@ -#!/usr/bin/perl use strict; use warnings; -use RT::Test tests => 21; +use RT::Test nodata => 1, tests => 23, config => 'Set($ShowUnreadMessageNotifications, 1);'; my $queue = RT::Test->load_or_create_queue( Name => 'Regression' ); ok $queue && $queue->id, 'loaded or created queue'; @@ -30,7 +29,7 @@ ok $agent_a->login('user_a', 'password'), 'logged in as user A'; my $agent_b = RT::Test::Web->new; ok $agent_b->login('user_b', 'password'), 'logged in as user B'; -diag "create a ticket for testing" if $ENV{TEST_VERBOSE}; +diag "create a ticket for testing"; my $tid; { my $ticket = RT::Ticket->new( $user_a ); @@ -44,7 +43,7 @@ my $tid; is $ticket->Owner, $user_a->id, 'correct owner'; } -diag "user B adds a message, we check that user A see notification and can clear it" if $ENV{TEST_VERBOSE}; +diag "user B adds a message, we check that user A see notification and can clear it"; { my $ticket = RT::Ticket->new( $user_b ); $ticket->Load( $tid ); @@ -62,10 +61,10 @@ diag "user B adds a message, we check that user A see notification and can clear ok( $reply_id, 'got correspond txn id' ); $agent_a->goto_ticket($tid); - $agent_a->content_like(qr/bla-bla/ims, 'the message on the page'); + $agent_a->content_contains('bla-bla', 'the message on the page'); - $agent_a->content_like( - qr/unread message/ims, + $agent_a->content_contains( + 'unread message', 'we have not seen something' ); @@ -76,20 +75,20 @@ diag "user B adds a message, we check that user A see notification and can clear like( $agent_a->base, qr/#txn-$reply_id$/, 'contains anchor' ); $agent_a->follow_link_ok({text => 'jump to the first unread message and mark all messages as seen'}, 'try to mark all as seen'); - $agent_a->content_like( - qr/Marked all messages as seen/ims, + $agent_a->content_contains( + 'Marked all messages as seen', 'see success message' ); like( $agent_a->base, qr/#txn-$reply_id$/, 'contains anchor' ); - $agent_a->content_like( - qr/Marked all messages as seen/ims, + $agent_a->content_contains( + 'Marked all messages as seen', 'see success message' ); $agent_a->goto_ticket($tid); - $agent_a->content_unlike( - qr/unread message/ims, + $agent_a->content_lacks( + 'unread message', 'we have seen everything, so no messages' ); }