[Rt-commit] r4171 - in rt/branches/QUEBEC-EXPERIMENTAL: . lib/t/regression

jesse at bestpractical.com jesse at bestpractical.com
Wed Nov 30 16:01:36 EST 2005


Author: jesse
Date: Wed Nov 30 16:01:35 2005
New Revision: 4171

Modified:
   rt/branches/QUEBEC-EXPERIMENTAL/   (props changed)
   rt/branches/QUEBEC-EXPERIMENTAL/lib/t/regression/06mailgateway.t
Log:
 r19569 at truegrounds:  jesse | 2005-11-30 15:37:06 -0500
  r18900 at truegrounds:  jesse | 2005-11-14 13:57:34 -0500
  RT-Ticket: 7122
  RT-Status: resolved
  RT-Update: correspond
  
  * Patch from Todd Chapman to honor changed a $rtname variable when running
    the test suite
 


Modified: rt/branches/QUEBEC-EXPERIMENTAL/lib/t/regression/06mailgateway.t
==============================================================================
--- rt/branches/QUEBEC-EXPERIMENTAL/lib/t/regression/06mailgateway.t	(original)
+++ rt/branches/QUEBEC-EXPERIMENTAL/lib/t/regression/06mailgateway.t	Wed Nov 30 16:01:35 2005
@@ -65,7 +65,7 @@
 ok(open(MAIL, "|$RT::BinPath/rt-mailgate --url http://this.test.for.non-connection.is.expected.to.generate.an.error"), "Opened the mailgate - The error below is expected - $@");
 print MAIL <<EOF;
 From: root\@localhost
-To: rt\@example.com
+To: rt\@$RT::rtname
 Subject: This is a test of new ticket creation
 
 Foob!
@@ -81,7 +81,7 @@
 ok(open(MAIL, "|$RT::BinPath/rt-mailgate  --debug --url $url --queue general --action correspond"), "Opened the mailgate - $@");
 print MAIL <<EOF;
 From: root\@localhost
-To: rt\@example.com
+To: rt\@$RT::rtname
 Subject: This is a test of new ticket creation
 
 Blah!
@@ -108,8 +108,8 @@
 
 ok(open(MAIL, "|$RT::BinPath/rt-mailgate --url $url --queue general --action correspond"), "Opened the mailgate - $@");
 print MAIL <<EOF;
-From: doesnotexist\@example.com
-To: rt\@example.com
+From: doesnotexist\@$RT::rtname
+To: rt\@$RT::rtname
 Subject: This is a test of new ticket creation as an unknown user
 
 Blah!
@@ -126,7 +126,7 @@
 ok ($tick->Id, "found ticket ".$tick->Id);
 ok ($tick->Subject ne 'This is a test of new ticket creation as an unknown user', "failed to create the new ticket from an unprivileged account");
 my $u = RT::User->new($RT::SystemUser);
-$u->Load('doesnotexist at example.com');
+$u->Load("doesnotexist\@$RT::rtname");
 ok( $u->Id == 0, " user does not exist and was not created by failed ticket submission");
 
 
@@ -144,8 +144,8 @@
 
 ok(open(MAIL, "|$RT::BinPath/rt-mailgate --url $url --queue general --action correspond"), "Opened the mailgate - $@");
 print MAIL <<EOF;
-From: doesnotexist\@example.com
-To: rt\@example.com
+From: doesnotexist\@$RT::rtname
+To: rt\@$RT::rtname
 Subject: This is a test of new ticket creation as an unknown user
 
 Blah!
@@ -163,7 +163,7 @@
 ok ($tick->Id, "found ticket ".$tick->Id);
 ok ($tick->Subject eq 'This is a test of new ticket creation as an unknown user', "failed to create the new ticket from an unprivileged account");
  $u = RT::User->new($RT::SystemUser);
-$u->Load('doesnotexist at example.com');
+$u->Load("doesnotexist\@$RT::rtname");
 ok( $u->Id != 0, " user does not exist and was created by ticket submission");
 
 # }}}
@@ -177,9 +177,9 @@
 
 ok(open(MAIL, "|$RT::BinPath/rt-mailgate --url $url --queue general --action correspond"), "Opened the mailgate - $@");
 print MAIL <<EOF;
-From: doesnotexist-2\@example.com
-To: rt\@example.com
-Subject: [example.com #@{[$tick->Id]}] This is a test of a reply as an unknown user
+From: doesnotexist-2\@$RT::rtname
+To: rt\@$RT::rtname
+Subject: [$RT::rtname #@{[$tick->Id]}] This is a test of a reply as an unknown user
 
 Blah!  (Should not work.)
 Foob!
@@ -189,7 +189,7 @@
 is ($? >> 8, 0, "The mail gateway exited normally. yay");
 
 $u = RT::User->new($RT::SystemUser);
-$u->Load('doesnotexist-2 at example.com');
+$u->Load('doesnotexist-2@$RT::rtname');
 ok( $u->Id == 0, " user does not exist and was not created by ticket correspondence submission");
 # }}}
 
@@ -202,9 +202,9 @@
 
 ok(open(MAIL, "|$RT::BinPath/rt-mailgate --url $url --queue general --action correspond"), "Opened the mailgate - $@");
 print MAIL <<EOF;
-From: doesnotexist-2\@example.com
-To: rt\@example.com
-Subject: [example.com #@{[$tick->Id]}] This is a test of a reply as an unknown user
+From: doesnotexist-2\@$RT::rtname
+To: rt\@$RT::rtname
+Subject: [$RT::rtname #@{[$tick->Id]}] This is a test of a reply as an unknown user
 
 Blah!
 Foob!
@@ -215,7 +215,7 @@
 
 
 $u = RT::User->new($RT::SystemUser);
-$u->Load('doesnotexist-2 at example.com');
+$u->Load("doesnotexist-2\@$RT::rtname");
 ok( $u->Id != 0, " user exists and was created by ticket correspondence submission");
 
 # }}}
@@ -228,9 +228,9 @@
 
 ok(open(MAIL, "|$RT::BinPath/rt-mailgate --url $url --queue general --action comment"), "Opened the mailgate - $@");
 print MAIL <<EOF;
-From: doesnotexist-3\@example.com
-To: rt\@example.com
-Subject: [example.com #@{[$tick->Id]}] This is a test of a comment as an unknown user
+From: doesnotexist-3\@$RT::rtname
+To: rt\@$RT::rtname
+Subject: [$RT::rtname #@{[$tick->Id]}] This is a test of a comment as an unknown user
 
 Blah!  (Should not work.)
 Foob!
@@ -241,7 +241,7 @@
 is ($? >> 8, 0, "The mail gateway exited normally. yay");
 
 $u = RT::User->new($RT::SystemUser);
-$u->Load('doesnotexist-3 at example.com');
+$u->Load("doesnotexist-3\@$RT::rtname");
 ok( $u->Id == 0, " user does not exist and was not created by ticket comment submission");
 
 # }}}
@@ -253,9 +253,9 @@
 
 ok(open(MAIL, "|$RT::BinPath/rt-mailgate --url $url --queue general --action comment"), "Opened the mailgate - $@");
 print MAIL <<EOF;
-From: doesnotexist-3\@example.com
-To: rt\@example.com
-Subject: [example.com #@{[$tick->Id]}] This is a test of a comment as an unknown user
+From: doesnotexist-3\@$RT::rtname
+To: rt\@$RT::rtname
+Subject: [$RT::rtname #@{[$tick->Id]}] This is a test of a comment as an unknown user
 
 Blah!
 Foob!
@@ -266,7 +266,7 @@
 is ($? >> 8, 0, "The mail gateway exited normally. yay");
 
 $u = RT::User->new($RT::SystemUser);
-$u->Load('doesnotexist-3 at example.com');
+$u->Load("doesnotexist-3\@$RT::rtname");
 ok( $u->Id != 0, " user exists and was created by ticket comment submission");
 
 # }}}
@@ -354,7 +354,7 @@
                                                                          
 print MAIL <<EOF;
 From: root\@localhost
-To: rtemail\@example.com
+To: rtemail\@$RT::rtname
 Subject: This is a test of I18N ticket creation
 Content-Type: text/plain; charset="utf-8"
 
@@ -388,7 +388,7 @@
                                                                          
 print MAIL <<EOF;
 From: root\@localhost
-To: rtemail\@example.com
+To: rtemail\@$RT::rtname
 Subject: This is a test of I18N ticket creation
 Content-Type: text/plain; charset="utf-8"
 
@@ -439,7 +439,7 @@
 ok(open(MAIL, "|$RT::BinPath/rt-mailgate --url $url --queue general --action take"), "Opened the mailgate - $@");
 print MAIL <<EOF;
 From: root\@localhost
-Subject: [example.com \#$id] test
+Subject: [$RT::rtname \#$id] test
 
 EOF
 close (MAIL);
@@ -463,7 +463,7 @@
 ok(open(MAIL, "|$RT::BinPath/rt-mailgate --url $RT::WebURL --queue general --action take-correspond"), "Opened the mailgate - $@");
 print MAIL <<EOF;
 From: root\@localhost
-Subject: [example.com \#$id] correspondence
+Subject: [$RT::rtname \#$id] correspondence
 
 test
 EOF
@@ -476,14 +476,14 @@
 is( $tick->OwnerObj->EmailAddress, 'root at localhost', 'successfuly take ticket via email');
 my $txns = $tick->Transactions;
 $txns->Limit( FIELD => 'Type', VALUE => 'Correspond');
-is( $txns->Last->Subject, "[example.com \#$id] correspondence", 'successfuly add correspond within take via email' );
+is( $txns->Last->Subject, "[$RT::rtname \#$id] correspondence", 'successfuly add correspond within take via email' );
 # +1 because of auto open
 is( $tick->Transactions->Count, 6, 'no superfluous transactions');
 
 ok(open(MAIL, "|$RT::BinPath/rt-mailgate --url $url --queue general --action resolve --debug"), "Opened the mailgate - $@");
 print MAIL <<EOF;
 From: root\@localhost
-Subject: [example.com \#$id] test
+Subject: [$RT::rtname \#$id] test
 
 EOF
 close (MAIL);


More information about the Rt-commit mailing list