[Rt-commit] rt branch, master, updated. rt-3.9.7-1170-gb2ee6fd

? sunnavy sunnavy at bestpractical.com
Fri Jan 7 09:16:42 EST 2011


The branch, master has been updated
       via  b2ee6fdb71b1ee7bd1b1f61f17ab0f64bab9b6e9 (commit)
       via  cbe5f1e5962cb98bb20d40c804af43ccb6ae5da0 (commit)
      from  0286dbb63c8e46214d560e272a82b52fccf1eca4 (commit)

Summary of changes:
 t/web/install.t |   35 +++++++++++++++++++++++++----------
 1 files changed, 25 insertions(+), 10 deletions(-)

- Log -----------------------------------------------------------------
commit cbe5f1e5962cb98bb20d40c804af43ccb6ae5da0
Author: sunnavy <sunnavy at bestpractical.com>
Date:   Fri Jan 7 22:13:10 2011 +0800

    test SendmailPath

diff --git a/t/web/install.t b/t/web/install.t
index c37a270..d22d700 100644
--- a/t/web/install.t
+++ b/t/web/install.t
@@ -2,7 +2,7 @@ use strict;
 use warnings;
 use File::Spec;
 use utf8;
-use RT::Test tests => 57, actual_server => 1, noinitialdata => 1;
+use RT::Test tests => 59, actual_server => 1, noinitialdata => 1;
 RT->InstallMode(1);
 
 my $dbname     = 'rt4test_install_xxx';
@@ -11,6 +11,8 @@ my $domain     = 'rttes.com';
 my $password   = 'newpass';
 my $correspond = 'reply at example.com';
 my $comment    = 'comment at example.com';
+# use bin/rt to fake sendmail to make sure the file exists
+my $sendmail   = File::Spec->catfile( $RT::BinPath, 'rt' );
 
 unlink File::Spec->catfile( $RT::VarPath, $dbname );
 
@@ -92,12 +94,21 @@ $m->field( 'Password'  => $password );
 $m->click;
 
 is( $m->uri, $url . '/Install/Sendmail.html', 'mail page' );
-$m->click;
-$m->content_contains( "doesn&#39;t look like an email address",
-    'got email error' );
 for my $field (qw/SendmailPath OwnerEmail/) {
     ok( $m->current_form->find_input($field), "has field $field" );
 }
+
+$m->field( 'OwnerEmail' => '' );
+$m->click;
+$m->content_contains( "doesn&#39;t look like an email address",
+    'got email error' );
+
+$m->field( 'SendmailPath' => '/fake/path/sendmail' );
+$m->click;
+$m->content_contains( "/fake/path/sendmail doesn&#39;t exist",
+    'got sendmail error' );
+
+$m->field( 'SendmailPath' => $sendmail );
 $m->field( 'OwnerEmail' => 'root at localhost' );
 $m->click;
 
@@ -142,6 +153,7 @@ is( $config->Get('DatabaseName'), $dbname,  'DatabaseName in config' );
 is( $config->Get('rtname'),       $rtname,  'rtname in config' );
 is( $config->Get('WebDomain'),    $domain,  'WebDomain email in config' );
 is( $config->Get('WebPort'),      $port,    'WebPort email in config' );
+is( $config->Get('SendmailPath'), $sendmail, 'SendmailPath in config' );
 is( $config->Get('CorrespondAddress'),
     $correspond, 'correspond address in config' );
 is( $config->Get('CommentAddress'), $comment, 'comment address in config' );

commit b2ee6fdb71b1ee7bd1b1f61f17ab0f64bab9b6e9
Author: sunnavy <sunnavy at bestpractical.com>
Date:   Fri Jan 7 22:15:34 2011 +0800

    more test about OwnerEmail

diff --git a/t/web/install.t b/t/web/install.t
index d22d700..1e85f12 100644
--- a/t/web/install.t
+++ b/t/web/install.t
@@ -2,7 +2,7 @@ use strict;
 use warnings;
 use File::Spec;
 use utf8;
-use RT::Test tests => 59, actual_server => 1, noinitialdata => 1;
+use RT::Test tests => 60, actual_server => 1, noinitialdata => 1;
 RT->InstallMode(1);
 
 my $dbname     = 'rt4test_install_xxx';
@@ -11,8 +11,10 @@ my $domain     = 'rttes.com';
 my $password   = 'newpass';
 my $correspond = 'reply at example.com';
 my $comment    = 'comment at example.com';
+
 # use bin/rt to fake sendmail to make sure the file exists
-my $sendmail   = File::Spec->catfile( $RT::BinPath, 'rt' );
+my $sendmail = File::Spec->catfile( $RT::BinPath, 'rt' );
+my $owner = 'root at localhost';
 
 unlink File::Spec->catfile( $RT::VarPath, $dbname );
 
@@ -109,7 +111,7 @@ $m->content_contains( "/fake/path/sendmail doesn&#39;t exist",
     'got sendmail error' );
 
 $m->field( 'SendmailPath' => $sendmail );
-$m->field( 'OwnerEmail' => 'root at localhost' );
+$m->field( 'OwnerEmail'   => $owner );
 $m->click;
 
 is( $m->uri, $url . '/Install/Global.html', 'global page' );
@@ -148,12 +150,13 @@ $m->content_contains( 'RT at a glance', 'logged in with newpass' );
 RT->LoadConfig;
 my $config = RT->Config;
 
-is( $config->Get('DatabaseType'), 'SQLite', 'DatabaseType in config' );
-is( $config->Get('DatabaseName'), $dbname,  'DatabaseName in config' );
-is( $config->Get('rtname'),       $rtname,  'rtname in config' );
-is( $config->Get('WebDomain'),    $domain,  'WebDomain email in config' );
-is( $config->Get('WebPort'),      $port,    'WebPort email in config' );
+is( $config->Get('DatabaseType'), 'SQLite',  'DatabaseType in config' );
+is( $config->Get('DatabaseName'), $dbname,   'DatabaseName in config' );
+is( $config->Get('rtname'),       $rtname,   'rtname in config' );
+is( $config->Get('WebDomain'),    $domain,   'WebDomain email in config' );
+is( $config->Get('WebPort'),      $port,     'WebPort email in config' );
 is( $config->Get('SendmailPath'), $sendmail, 'SendmailPath in config' );
+is( $config->Get('OwnerEmail'),   $owner,    'OwnerEmail in config' );
 is( $config->Get('CorrespondAddress'),
     $correspond, 'correspond address in config' );
 is( $config->Get('CommentAddress'), $comment, 'comment address in config' );

-----------------------------------------------------------------------


More information about the Rt-commit mailing list