X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=rt%2Ft%2Fmail%2Fdigest-attributes.t;h=a0940dbb186aecf52d5029ed59100922502357b3;hb=de9d037528895f7151a9aead6724ce2df95f9586;hp=5b456062115719bb7bb452269fcad27ac1409290;hpb=f3c4966ed1f6ec3db7accd6dcdd3a5a3821d72a7;p=freeside.git diff --git a/rt/t/mail/digest-attributes.t b/rt/t/mail/digest-attributes.t index 5b4560621..a0940dbb1 100644 --- a/rt/t/mail/digest-attributes.t +++ b/rt/t/mail/digest-attributes.t @@ -1,4 +1,3 @@ -#!/usr/bin/perl -w use warnings; use strict; @@ -52,48 +51,48 @@ my $everyone = RT::Group->new( RT->SystemUser ); ok( $ret, "Loaded 'everyone' group: $msg" ); ( $ret, $msg ) = $everyone->PrincipalObj->GrantRight( Right => 'CreateTicket', - Object => $testq ); + Object => $testq ); ok( $ret || $msg =~ /already has/, "Granted everyone CreateTicket on testq: $msg" ); # Make user_d an admincc for the queue. ( $ret, $msg ) = $user_d->PrincipalObj->GrantRight( Right => 'AdminQueue', - Object => $testq ); + Object => $testq ); ok( $ret || $msg =~ /already has/, "Granted dduser AdminQueue on testq: $msg" ); ( $ret, $msg ) = $testq->AddWatcher( Type => 'AdminCc', - PrincipalId => $user_d->PrincipalObj->id ); + PrincipalId => $user_d->PrincipalObj->id ); ok( $ret || $msg =~ /already/, "dduser added as a queue watcher: $msg" ); # Give the others queue rights. ( $ret, $msg ) = $user_n->PrincipalObj->GrantRight( Right => 'AdminQueue', - Object => $testq ); + Object => $testq ); ok( $ret || $msg =~ /already has/, "Granted emailnormal right on testq: $msg" ); ( $ret, $msg ) = $user_w->PrincipalObj->GrantRight( Right => 'AdminQueue', - Object => $testq ); + Object => $testq ); ok( $ret || $msg =~ /already has/, "Granted emailweekly right on testq: $msg" ); ( $ret, $msg ) = $user_s->PrincipalObj->GrantRight( Right => 'AdminQueue', - Object => $testq ); + Object => $testq ); ok( $ret || $msg =~ /already has/, "Granted emailsusp right on testq: $msg" ); # Create a ticket with To: Cc: Bcc: fields using our four users. my $id; my $ticket = RT::Ticket->new( RT->SystemUser ); ( $id, $ret, $msg ) = $ticket->Create( Queue => $testq->Name, - Requestor => [ $user_w->Name ], - Subject => 'Test ticket for RT::Extension::EmailDigest', - ); + Requestor => [ $user_w->Name ], + Subject => 'Test ticket for RT::Extension::EmailDigest', + ); ok( $ret, "Ticket $id created: $msg" ); # Make the other users ticket watchers. ( $ret, $msg ) = $ticket->AddWatcher( Type => 'Cc', - PrincipalId => $user_n->PrincipalObj->id ); + PrincipalId => $user_n->PrincipalObj->id ); ok( $ret, "Added user_n as a ticket watcher: $msg" ); ( $ret, $msg ) = $ticket->AddWatcher( Type => 'Cc', - PrincipalId => $user_s->PrincipalObj->id ); + PrincipalId => $user_s->PrincipalObj->id ); ok( $ret, "Added user_s as a ticket watcher: $msg" ); my $obj; ($id, $msg, $obj ) = $ticket->Correspond( - Content => "This is a ticket response for CC action" ); + Content => "This is a ticket response for CC action" ); ok( $ret, "Transaction created: $msg" ); # Get the deferred notifications that should result. Should be two for @@ -114,11 +113,11 @@ while( my $txn = $txns->Next ) { # If the transaction has content... if( $txn->ContentObj ) { - # ...none of the deferred folk should be in the header. - my $headerstr = $txn->ContentObj->Headers; - foreach my $rcpt( @daily_rcpt, @weekly_rcpt, @susp_rcpt ) { - ok( $headerstr !~ /$rcpt/, "Deferred recipient $rcpt not found in header" ); - } + # ...none of the deferred folk should be in the header. + my $headerstr = $txn->ContentObj->Headers; + foreach my $rcpt( @daily_rcpt, @weekly_rcpt, @susp_rcpt ) { + ok( $headerstr !~ /$rcpt/, "Deferred recipient $rcpt not found in header" ); + } } } @@ -137,14 +136,14 @@ is( $c_susp, 1, "correct number of suspended messages" ); # the first time get the content email_digest_like( '--mode daily --print', qr/in the last day/ ); # The second time run it for real so we make sure that we get RT to mark the txn as sent -email_digest_like( '--mode daily', qr/maildaily\@/ ); +email_digest_like( '--mode daily --verbose', qr/maildaily\@/ ); # now we should have nothing to do, so no content. email_digest_like( '--mode daily --print', '' ); # the first time get the content email_digest_like( '--mode weekly --print', qr/in the last seven days/ ); # The second time run it for real so we make sure that we get RT to mark the txn as sent -email_digest_like( '--mode weekly', qr/mailweekly\@/ ); +email_digest_like( '--mode weekly --verbose', qr/mailweekly\@/ ); # now we should have nothing to do, so no content. email_digest_like( '--mode weekly --print', '' );