summaryrefslogtreecommitdiff
path: root/rt/lib/t
diff options
context:
space:
mode:
Diffstat (limited to 'rt/lib/t')
-rw-r--r--rt/lib/t/02regression.t.in6
-rw-r--r--rt/lib/t/04_send_email.pl.in25
-rw-r--r--rt/lib/t/data/rt-send-cc5
3 files changed, 34 insertions, 2 deletions
diff --git a/rt/lib/t/02regression.t.in b/rt/lib/t/02regression.t.in
index 8c050ff5b..7862ef407 100644
--- a/rt/lib/t/02regression.t.in
+++ b/rt/lib/t/02regression.t.in
@@ -34,10 +34,12 @@ is($q2->CommentAddress, 'comment@a');
use File::Find;
-File::Find::find({wanted => \&wanted_autogen}, 'lib/t/autogen');
+File::Find::find({wanted => \&wanted_autogen,
+ preprocess => sub {return sort @_}}, 'lib/t/autogen');
sub wanted_autogen { /^autogen.*\.t\z/s && require $_; }
-File::Find::find({wanted => \&wanted_regression}, 'lib/t/regression');
+File::Find::find({wanted => \&wanted_regression,
+ preprocess => sub {return sort @_}}, 'lib/t/regression');
sub wanted_regression { /^*\.t\z/s && require $_; }
require "@RT_LIB_PATH@/t/03web.pl";
diff --git a/rt/lib/t/04_send_email.pl.in b/rt/lib/t/04_send_email.pl.in
index 2bdf4c5a6..39ab0d271 100644
--- a/rt/lib/t/04_send_email.pl.in
+++ b/rt/lib/t/04_send_email.pl.in
@@ -476,6 +476,31 @@ sub crashes_redef_sendmessage {
# }}}
+# {{{ test a multi-line RT-Send-CC header
+
+my $content = `cat @RT_LIB_PATH@/t/data/rt-send-cc` || die "couldn't find new content";
+
+$parser->ParseMIMEEntityFromScalar($content);
+
+
+
+my %args = (message => $content, queue => 1, action => 'correspond');
+ RT::Interface::Email::Gateway(\%args);
+my $tickets = RT::Tickets->new($RT::SystemUser);
+$tickets->OrderBy(FIELD => 'id', ORDER => 'DESC');
+$tickets->Limit(FIELD => 'id' ,OPERATOR => '>', VALUE => '0');
+my $tick = $tickets->First();
+ok ($tick->Id, "found ticket ".$tick->Id);
+
+my $cc = $tick->Transactions->First->Attachments->First->GetHeader('RT-Send-Cc');
+ok ($cc =~ /test1/, "Found test 1");
+ok ($cc =~ /test2/, "Found test 2");
+ok ($cc =~ /test3/, "Found test 3");
+ok ($cc =~ /test4/, "Found test 4");
+ok ($cc =~ /test5/, "Found test 5");
+
+# }}}
+
# Don't taint the environment
$everyone->PrincipalObj->RevokeRight(Right =>'SuperUser');
1;
diff --git a/rt/lib/t/data/rt-send-cc b/rt/lib/t/data/rt-send-cc
new file mode 100644
index 000000000..da8c4daff
--- /dev/null
+++ b/rt/lib/t/data/rt-send-cc
@@ -0,0 +1,5 @@
+From: rt@example.com
+subject: testing send-cc headers
+RT-Send-Cc: this-is-a-sample-test1e@example.com, second-this-is-a-sample-test2@example.com, test-sample-sample-sample-test3@example.com,
+ afourthtest4@example.com,
+ test5@example.com