X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=rt%2Ft%2Fmail%2Fcharsets-outgoing.t;h=2fc91f2e03f78462a7f805e7b49450d7348783f6;hb=56edd581cc007c2c94fba2d81ce2d4829355df1f;hp=e3f13fb6c14e5145cc03cc744f59873f75da3165;hpb=b5c4237a34aef94976bc343c8d9e138664fc3984;p=freeside.git diff --git a/rt/t/mail/charsets-outgoing.t b/rt/t/mail/charsets-outgoing.t index e3f13fb6c..2fc91f2e0 100644 --- a/rt/t/mail/charsets-outgoing.t +++ b/rt/t/mail/charsets-outgoing.t @@ -1,4 +1,3 @@ -#!/usr/bin/perl use strict; use warnings; use Encode; @@ -18,8 +17,6 @@ my %string = ( }, ); -RT::Test->set_mail_catcher; - my $queue = RT::Test->load_or_create_queue( Name => 'Regression', CorrespondAddress => 'rt-recipient@example.com', @@ -27,15 +24,15 @@ my $queue = RT::Test->load_or_create_queue( ); ok $queue && $queue->id, 'loaded or created queue'; -diag "make sure queue has no subject tag" if $ENV{'TEST_VERBOSE'}; +diag "make sure queue has no subject tag"; { my ($status, $msg) = $queue->SetSubjectTag( undef ); ok $status, "set subject tag for the queue" or diag "error: $msg"; } -diag "set intial simple autoreply template" if $ENV{'TEST_VERBOSE'}; +diag "set intial simple autoreply template"; { - my $template = RT::Template->new( $RT::SystemUser ); + my $template = RT::Template->new( RT->SystemUser ); $template->Load('Autoreply'); ok $template->id, "loaded autoreply tempalte"; @@ -49,9 +46,9 @@ diag "set intial simple autoreply template" if $ENV{'TEST_VERBOSE'}; or diag "error: $msg"; } -diag "basic test of autoreply" if $ENV{'TEST_VERBOSE'}; +diag "basic test of autoreply"; { - my $ticket = RT::Ticket->new( $RT::SystemUser ); + my $ticket = RT::Ticket->new( RT->SystemUser ); $ticket->Create( Queue => $queue->id, Subject => 'test', @@ -61,10 +58,9 @@ diag "basic test of autoreply" if $ENV{'TEST_VERBOSE'}; ok @mails, "got some outgoing emails"; } -diag "non-ascii Subject with ascii prefix set in the template" - if $ENV{'TEST_VERBOSE'}; +diag "non-ascii Subject with ascii prefix set in the template"; foreach my $set ( 'ru', 'latin1' ) { - my $ticket = RT::Ticket->new( $RT::SystemUser ); + my $ticket = RT::Ticket->new( RT->SystemUser ); $ticket->Create( Queue => $queue->id, Subject => $string{$set}{test}, @@ -85,15 +81,15 @@ foreach my $set ( 'ru', 'latin1' ) { foreach my $tag_set ( 'ru', 'latin1' ) { -diag "set non-ascii subject tag for the queue" if $ENV{'TEST_VERBOSE'}; +diag "set non-ascii subject tag for the queue"; { my ($status, $msg) = $queue->SetSubjectTag( $string{$tag_set}{support} ); ok $status, "set subject tag for the queue" or diag "error: $msg"; } -diag "ascii subject with non-ascii subject tag" if $ENV{'TEST_VERBOSE'}; +diag "ascii subject with non-ascii subject tag"; { - my $ticket = RT::Ticket->new( $RT::SystemUser ); + my $ticket = RT::Ticket->new( RT->SystemUser ); $ticket->Create( Queue => $queue->id, Subject => 'test', @@ -112,9 +108,9 @@ diag "ascii subject with non-ascii subject tag" if $ENV{'TEST_VERBOSE'}; ok $status, "all mails have correct data"; } -diag "non-ascii subject with non-ascii subject tag" if $ENV{'TEST_VERBOSE'}; +diag "non-ascii subject with non-ascii subject tag"; foreach my $set ( 'ru', 'latin1' ) { - my $ticket = RT::Ticket->new( $RT::SystemUser ); + my $ticket = RT::Ticket->new( RT->SystemUser ); $ticket->Create( Queue => $queue->id, Subject => $string{$set}{test}, @@ -137,7 +133,7 @@ foreach my $set ( 'ru', 'latin1' ) { } # subject tag -diag "return back the empty subject tag" if $ENV{'TEST_VERBOSE'}; +diag "return back the empty subject tag"; { my ($status, $msg) = $queue->SetSubjectTag( undef ); ok $status, "set subject tag for the queue" or diag "error: $msg"; @@ -146,9 +142,9 @@ diag "return back the empty subject tag" if $ENV{'TEST_VERBOSE'}; foreach my $prefix_set ( 'ru', 'latin1' ) { -diag "add non-ascii subject prefix in the autoreply template" if $ENV{'TEST_VERBOSE'}; +diag "add non-ascii subject prefix in the autoreply template"; { - my $template = RT::Template->new( $RT::SystemUser ); + my $template = RT::Template->new( RT->SystemUser ); $template->Load('Autoreply'); ok $template->id, "loaded autoreply tempalte"; @@ -161,9 +157,9 @@ diag "add non-ascii subject prefix in the autoreply template" if $ENV{'TEST_VERB ok $status, "changed content of the template" or diag "error: $msg"; } -diag "ascii subject with non-ascii subject prefix in template" if $ENV{'TEST_VERBOSE'}; +diag "ascii subject with non-ascii subject prefix in template"; { - my $ticket = RT::Ticket->new( $RT::SystemUser ); + my $ticket = RT::Ticket->new( RT->SystemUser ); $ticket->Create( Queue => $queue->id, Subject => 'test', @@ -182,10 +178,9 @@ diag "ascii subject with non-ascii subject prefix in template" if $ENV{'TEST_VER ok $status, "all mails have correct data"; } -diag "non-ascii subject with non-ascii subject prefix in template" - if $ENV{'TEST_VERBOSE'}; +diag "non-ascii subject with non-ascii subject prefix in template"; foreach my $set ( 'ru', 'latin1' ) { - my $ticket = RT::Ticket->new( $RT::SystemUser ); + my $ticket = RT::Ticket->new( RT->SystemUser ); $ticket->Create( Queue => $queue->id, Subject => $string{$set}{test}, @@ -207,16 +202,15 @@ foreach my $set ( 'ru', 'latin1' ) { } foreach my $tag_set ( 'ru', 'latin1' ) { -diag "set non-ascii subject tag for the queue" if $ENV{'TEST_VERBOSE'}; +diag "set non-ascii subject tag for the queue"; { my ($status, $msg) = $queue->SetSubjectTag( $string{$tag_set}{support} ); ok $status, "set subject tag for the queue" or diag "error: $msg"; } -diag "non-ascii subject, non-ascii prefix in template and non-ascii tag" - if $ENV{'TEST_VERBOSE'}; +diag "non-ascii subject, non-ascii prefix in template and non-ascii tag"; foreach my $set ( 'ru', 'latin1' ) { - my $ticket = RT::Ticket->new( $RT::SystemUser ); + my $ticket = RT::Ticket->new( RT->SystemUser ); $ticket->Create( Queue => $queue->id, Subject => $string{$set}{test}, @@ -241,7 +235,7 @@ foreach my $set ( 'ru', 'latin1' ) { } # subject tag -diag "flush subject tag of the queue" if $ENV{'TEST_VERBOSE'}; +diag "flush subject tag of the queue"; { my ($status, $msg) = $queue->SetSubjectTag( undef ); ok $status, "set subject tag for the queue" or diag "error: $msg"; @@ -250,11 +244,11 @@ diag "flush subject tag of the queue" if $ENV{'TEST_VERBOSE'}; } # prefix set -diag "don't change subject via template" if $ENV{'TEST_VERBOSE'}; +diag "don't change subject via template"; # clean DB has autoreply that always changes subject in template, # we should test situation when subject is not changed from template { - my $template = RT::Template->new( $RT::SystemUser ); + my $template = RT::Template->new( RT->SystemUser ); $template->Load('Autoreply'); ok $template->id, "loaded autoreply tempalte"; @@ -267,9 +261,9 @@ diag "don't change subject via template" if $ENV{'TEST_VERBOSE'}; ok $status, "changed content of the template" or diag "error: $msg"; } -diag "non-ascii Subject without changes in template" if $ENV{'TEST_VERBOSE'}; +diag "non-ascii Subject without changes in template"; foreach my $set ( 'ru', 'latin1' ) { - my $ticket = RT::Ticket->new( $RT::SystemUser ); + my $ticket = RT::Ticket->new( RT->SystemUser ); $ticket->Create( Queue => $queue->id, Subject => $string{$set}{test}, @@ -289,16 +283,15 @@ foreach my $set ( 'ru', 'latin1' ) { } foreach my $tag_set ( 'ru', 'latin1' ) { -diag "set non-ascii subject tag for the queue" if $ENV{'TEST_VERBOSE'}; +diag "set non-ascii subject tag for the queue"; { my ($status, $msg) = $queue->SetSubjectTag( $string{$tag_set}{support} ); ok $status, "set subject tag for the queue" or diag "error: $msg"; } -diag "non-ascii Subject without changes in template and with non-ascii subject tag" - if $ENV{'TEST_VERBOSE'}; +diag "non-ascii Subject without changes in template and with non-ascii subject tag"; foreach my $set ( 'ru', 'latin1' ) { - my $ticket = RT::Ticket->new( $RT::SystemUser ); + my $ticket = RT::Ticket->new( RT->SystemUser ); $ticket->Create( Queue => $queue->id, Subject => $string{$set}{test}, @@ -320,3 +313,4 @@ foreach my $set ( 'ru', 'latin1' ) { } } # subject tag set +