[Rt-commit] r5930 - in rt/branches/3.7-EXPERIMENTAL: .

ruz at bestpractical.com ruz at bestpractical.com
Wed Sep 13 19:27:01 EDT 2006


Author: ruz
Date: Wed Sep 13 19:26:59 2006
New Revision: 5930

Modified:
   rt/branches/3.7-EXPERIMENTAL/   (props changed)
   rt/branches/3.7-EXPERIMENTAL/lib/t/regression/06mailgateway.t

Log:
 r3732 at cubic-pc:  cubic | 2006-09-14 02:31:19 +0400
 mailgate tests
 * test behaviour when wrong arguments have been passed


Modified: rt/branches/3.7-EXPERIMENTAL/lib/t/regression/06mailgateway.t
==============================================================================
--- rt/branches/3.7-EXPERIMENTAL/lib/t/regression/06mailgateway.t	(original)
+++ rt/branches/3.7-EXPERIMENTAL/lib/t/regression/06mailgateway.t	Wed Sep 13 19:26:59 2006
@@ -54,7 +54,7 @@
 use strict;
 use warnings;
 
-use Test::More tests => 64;
+use Test::More tests => 68;
 
 use RT;
 RT::LoadConfig();
@@ -127,7 +127,35 @@
     return $tickets->First;
 }
 
-diag "Make sure that when we call the mailgate wrong, it tempfails" if $ENV{'TEST_VERBOSE'};
+diag "Make sure that when we call the mailgate without URL, it fails" if $ENV{'TEST_VERBOSE'};
+{
+    my $text = <<EOF;
+From: root\@localhost
+To: rt\@@{[RT->Config->Get('rtname')]}
+Subject: This is a test of new ticket creation
+
+Foob!
+EOF
+    my ($status, $id) = create_ticket_via_gate($text, url => undef);
+    is ($status >> 8, 1, "The mail gateway exited with a failure");
+    ok (!$id, "No ticket id") or diag "by mistake ticket #$id";
+}
+
+diag "Make sure that when we call the mailgate with wrong --extension, it fails" if $ENV{'TEST_VERBOSE'};
+{
+    my $text = <<EOF;
+From: root\@localhost
+To: rt\@@{[RT->Config->Get('rtname')]}
+Subject: This is a test of new ticket creation
+
+Foob!
+EOF
+    my ($status, $id) = create_ticket_via_gate($text, extension => 'bad-extension-arg' );
+    is ($status >> 8, 1, "The mail gateway exited with a failure");
+    ok (!$id, "No ticket id") or diag "by mistake ticket #$id";
+}
+
+diag "Make sure that when we call the mailgate with wrong URL, it tempfails" if $ENV{'TEST_VERBOSE'};
 {
     my $text = <<EOF;
 From: root\@localhost
@@ -141,7 +169,6 @@
     ok (!$id, "No ticket id");
 }
 
-
 my $everyone_group;
 diag "revoke rights tests depend on";
 {


More information about the Rt-commit mailing list