]> git.donarmstrong.com Git - debbugs.git/blobdiff - t/14_control_at_submit.t
Don't print strange-looking "Usertags are now: ." message when removing all usertags.
[debbugs.git] / t / 14_control_at_submit.t
index 38ea9d864181f78c2c3560be0a8b3b39824e9923..950d1a973a4bccc9151fafeb6c13dabb9e080c74 100644 (file)
@@ -1,7 +1,7 @@
 # -*- mode: cperl;-*-
 # $Id: 05_mail.t,v 1.1 2005/08/17 21:46:17 don Exp $
 
-use Test::More tests => 120;
+use Test::More tests => 122;
 
 use warnings;
 use strict;
@@ -26,25 +26,14 @@ use Encode qw(decode encode);
 
 # HTTP::Server:::Simple defines a SIG{CHLD} handler that breaks system; undef it here.
 $SIG{CHLD} = sub {};
-my %config;
-eval {
-     %config = create_debbugs_configuration(debug => exists $ENV{DEBUG}?$ENV{DEBUG}:0);
-};
-if ($@) {
-     BAIL_OUT($@);
-}
+my %config = create_debbugs_configuration();
+
 
 my $sendmail_dir = $config{sendmail_dir};
 my $spool_dir = $config{spool_dir};
 my $config_dir = $config{config_dir};
 
-END{
-     if ($ENV{DEBUG}) {
-         diag("spool_dir:   $spool_dir\n");
-         diag("config_dir:   $config_dir\n");
-         diag("sendmail_dir: $sendmail_dir\n");
-     }
-}
+
 
 # We're going to use create mime message to create these messages, and
 # then just send them to receive.
@@ -140,6 +129,21 @@ ok(system('sh','-c','find '.$sendmail_dir.q( -type f | xargs grep -q "Subject: P
 $status = read_bug(bug=>2);
 ok($status->{subject} eq 'this is a new title','bug 2 retitled at submit@ time');
 
+send_message(to => '1@bugs.something',
+            headers => [To   => '1@bugs.something',
+                        From => 'foo@bugs.something',
+                        Subject => 'Testing control at 1@bugs.something',
+                       ],
+            body => <<EOF) or fail 'message to 1@bugs.something failed';
+Control: retitle -1 this is now the title of bug 1
+EOF
+
+ok(system('sh','-c','find '.$sendmail_dir.q( -type f | xargs grep -q "Subject: Processed: Testing control at 1@bugs.something")) == 0,
+   '1@bugs.something message was parsed without errors');
+
+$status = read_bug(bug=>1);
+ok($status->{subject} eq 'this is now the title of bug 1','bug 1 retitled at 1@ time');
+
 
 
 # now we're going to go through and methododically test all of the control commands.