[Rt-commit] r15024 - in rtir/branches/2.3-TESTING/t: . constituency lib/RT/IR mail
ruz at bestpractical.com
ruz at bestpractical.com
Mon Aug 11 21:06:47 EDT 2008
Author: ruz
Date: Mon Aug 11 21:06:44 2008
New Revision: 15024
Modified:
rtir/branches/2.3-TESTING/t/001-basic-RTIR.t
rtir/branches/2.3-TESTING/t/002-test-reject.t
rtir/branches/2.3-TESTING/t/003-resolve-IR-when-all-incidents-resolved.t
rtir/branches/2.3-TESTING/t/004-rtfm-in-rtir.t
rtir/branches/2.3-TESTING/t/005-resolve-investigations.t
rtir/branches/2.3-TESTING/t/006-saved-searches.t
rtir/branches/2.3-TESTING/t/008-workflow-blocks.t
rtir/branches/2.3-TESTING/t/009-attachments-processing.t
rtir/branches/2.3-TESTING/t/010-bulk-reject.t
rtir/branches/2.3-TESTING/t/011-merge.t
rtir/branches/2.3-TESTING/t/013-custom-field-ip.t
rtir/branches/2.3-TESTING/t/015-make-clicky.t
rtir/branches/2.3-TESTING/t/016-date-due.t
rtir/branches/2.3-TESTING/t/016-date-started.t
rtir/branches/2.3-TESTING/t/019-watchers-on-create.t
rtir/branches/2.3-TESTING/t/019-webui-block-fields.t
rtir/branches/2.3-TESTING/t/020-incident-and-investigation.t
rtir/branches/2.3-TESTING/t/021-gnupg-on-create.t
rtir/branches/2.3-TESTING/t/022-gnupg-on-update.t
rtir/branches/2.3-TESTING/t/023-gnupg-on-incident.t
rtir/branches/2.3-TESTING/t/constituency/acl.t
rtir/branches/2.3-TESTING/t/constituency/basics.t
rtir/branches/2.3-TESTING/t/constituency/email.t
rtir/branches/2.3-TESTING/t/constituency/email_outgoing.t
rtir/branches/2.3-TESTING/t/constituency/propagation-inherit.t
rtir/branches/2.3-TESTING/t/constituency/propagation-no.t
rtir/branches/2.3-TESTING/t/constituency/propagation-reject.t
rtir/branches/2.3-TESTING/t/incident/abandon.t
rtir/branches/2.3-TESTING/t/incident/bulk-abandon.t
rtir/branches/2.3-TESTING/t/incident/split.t
rtir/branches/2.3-TESTING/t/lib/RT/IR/Test.pm
rtir/branches/2.3-TESTING/t/mail/skip_notification.t
rtir/branches/2.3-TESTING/t/rtir-test.pl
Log:
* switch RTIR tests completly to RT::Test module
Modified: rtir/branches/2.3-TESTING/t/001-basic-RTIR.t
==============================================================================
--- rtir/branches/2.3-TESTING/t/001-basic-RTIR.t (original)
+++ rtir/branches/2.3-TESTING/t/001-basic-RTIR.t Mon Aug 11 21:06:44 2008
@@ -3,9 +3,8 @@
use strict;
use warnings;
-BEGIN { require "t/rtir-test.pl" };
-use lib 't/lib';
-use RT::IR::Test tests => 25;
+require "t/rtir-test.pl";
+use Test::More tests => 25;
RT::Test->started_ok;
my $agent = default_agent();
Modified: rtir/branches/2.3-TESTING/t/002-test-reject.t
==============================================================================
--- rtir/branches/2.3-TESTING/t/002-test-reject.t (original)
+++ rtir/branches/2.3-TESTING/t/002-test-reject.t Mon Aug 11 21:06:44 2008
@@ -2,10 +2,11 @@
use strict;
use warnings;
-use Test::More tests => 111;
require "t/rtir-test.pl";
+use Test::More tests => 115;
+RT::Test->started_ok;
my $agent = default_agent();
# Create some reports
Modified: rtir/branches/2.3-TESTING/t/003-resolve-IR-when-all-incidents-resolved.t
==============================================================================
--- rtir/branches/2.3-TESTING/t/003-resolve-IR-when-all-incidents-resolved.t (original)
+++ rtir/branches/2.3-TESTING/t/003-resolve-IR-when-all-incidents-resolved.t Mon Aug 11 21:06:44 2008
@@ -2,10 +2,11 @@
use strict;
use warnings;
-use Test::More tests => 29;
require "t/rtir-test.pl";
+use Test::More tests => 33;
+RT::Test->started_ok;
my $agent = default_agent();
my $ir_id = create_ir($agent, {Subject => "resolves slowly"});
Modified: rtir/branches/2.3-TESTING/t/004-rtfm-in-rtir.t
==============================================================================
--- rtir/branches/2.3-TESTING/t/004-rtfm-in-rtir.t (original)
+++ rtir/branches/2.3-TESTING/t/004-rtfm-in-rtir.t Mon Aug 11 21:06:44 2008
@@ -2,10 +2,11 @@
use strict;
use warnings;
-use Test::More tests => 15;
require "t/rtir-test.pl";
+use Test::More tests => 19;
+RT::Test->started_ok;
my $agent = default_agent();
my $ir_id = create_ir($agent, {Subject => "looking for rtfm"});
Modified: rtir/branches/2.3-TESTING/t/005-resolve-investigations.t
==============================================================================
--- rtir/branches/2.3-TESTING/t/005-resolve-investigations.t (original)
+++ rtir/branches/2.3-TESTING/t/005-resolve-investigations.t Mon Aug 11 21:06:44 2008
@@ -2,10 +2,11 @@
use strict;
use warnings;
-use Test::More tests => 20;
require "t/rtir-test.pl";
+use Test::More tests => 24;
+RT::Test->started_ok;
my $agent = default_agent();
my $inv_id = create_investigation($agent, {Subject => "i want to quick-resolve this"});
Modified: rtir/branches/2.3-TESTING/t/006-saved-searches.t
==============================================================================
--- rtir/branches/2.3-TESTING/t/006-saved-searches.t (original)
+++ rtir/branches/2.3-TESTING/t/006-saved-searches.t Mon Aug 11 21:06:44 2008
@@ -2,10 +2,11 @@
use strict;
use warnings;
-use Test::More tests => 15;
require "t/rtir-test.pl";
+use Test::More tests => 19;
+RT::Test->started_ok;
my $agent = default_agent();
$agent->follow_link_ok({text => "RT"}, "went to main RT page");
Modified: rtir/branches/2.3-TESTING/t/008-workflow-blocks.t
==============================================================================
--- rtir/branches/2.3-TESTING/t/008-workflow-blocks.t (original)
+++ rtir/branches/2.3-TESTING/t/008-workflow-blocks.t Mon Aug 11 21:06:44 2008
@@ -2,10 +2,11 @@
use strict;
use warnings;
-use Test::More tests => 108;
require "t/rtir-test.pl";
+use Test::More tests => 112;
+RT::Test->started_ok;
my $agent = default_agent();
my $inc_id = create_incident($agent, {Subject => "incident with block"});
Modified: rtir/branches/2.3-TESTING/t/009-attachments-processing.t
==============================================================================
--- rtir/branches/2.3-TESTING/t/009-attachments-processing.t (original)
+++ rtir/branches/2.3-TESTING/t/009-attachments-processing.t Mon Aug 11 21:06:44 2008
@@ -2,7 +2,12 @@
use strict;
use warnings;
-use Test::More tests => 50;
+
+require "t/rtir-test.pl";
+use Test::More tests => 54;
+
+RT::Test->started_ok;
+my $agent = default_agent();
sub tempfile {
require File::Temp;
@@ -14,10 +19,6 @@
return $filename;
}
-require "t/rtir-test.pl";
-
-my $agent = default_agent();
-
$agent->follow_link_ok({text => 'Incident Reports'}, "go to 'Incident Reports'");
$agent->follow_link_ok({text => 'New Report'}, "go to 'New Report'");
Modified: rtir/branches/2.3-TESTING/t/010-bulk-reject.t
==============================================================================
--- rtir/branches/2.3-TESTING/t/010-bulk-reject.t (original)
+++ rtir/branches/2.3-TESTING/t/010-bulk-reject.t Mon Aug 11 21:06:44 2008
@@ -2,10 +2,11 @@
use strict;
use warnings;
-use Test::More tests => 43;
require "t/rtir-test.pl";
+use Test::More tests => 47;
+RT::Test->started_ok;
my $agent = default_agent();
# Create some reports
Modified: rtir/branches/2.3-TESTING/t/011-merge.t
==============================================================================
--- rtir/branches/2.3-TESTING/t/011-merge.t (original)
+++ rtir/branches/2.3-TESTING/t/011-merge.t Mon Aug 11 21:06:44 2008
@@ -2,10 +2,11 @@
use strict;
use warnings;
-use Test::More tests => 114;
require "t/rtir-test.pl";
+use Test::More tests => 118;
+RT::Test->started_ok;
my $agent = default_agent();
diag "simple merge of IRs" if $ENV{'TEST_VERBOSE'};
Modified: rtir/branches/2.3-TESTING/t/013-custom-field-ip.t
==============================================================================
--- rtir/branches/2.3-TESTING/t/013-custom-field-ip.t (original)
+++ rtir/branches/2.3-TESTING/t/013-custom-field-ip.t Mon Aug 11 21:06:44 2008
@@ -2,13 +2,12 @@
use strict;
use warnings;
-use Test::More tests => 483;
require "t/rtir-test.pl";
+use Test::More tests => 486;
-use_ok('RT');
-RT::LoadConfig();
-RT::Init();
+RT::Test->started_ok;
+my $agent = default_agent();
use_ok('RT::IR');
@@ -38,7 +37,6 @@
}
}
-my $agent = default_agent();
my $rtir_user = RT::CurrentUser->new( rtir_user() );
diag "create a ticket via web and set IP" if $ENV{'TEST_VERBOSE'};
Modified: rtir/branches/2.3-TESTING/t/015-make-clicky.t
==============================================================================
--- rtir/branches/2.3-TESTING/t/015-make-clicky.t (original)
+++ rtir/branches/2.3-TESTING/t/015-make-clicky.t Mon Aug 11 21:06:44 2008
@@ -3,18 +3,12 @@
use strict;
use warnings;
-use Test::More tests => 33;
-
require "t/rtir-test.pl";
+use Test::More tests => 33;
-use_ok('RT');
-RT::LoadConfig();
-RT::Init();
-
-use_ok('RT::IR');
-
-
+RT::Test->started_ok;
my $agent = default_agent();
+
my $rtir_user = RT::CurrentUser->new( rtir_user() );
my %clicky = map { lc $_ => 1 } RT->Config->Get('Active_MakeClicky');
Modified: rtir/branches/2.3-TESTING/t/016-date-due.t
==============================================================================
--- rtir/branches/2.3-TESTING/t/016-date-due.t (original)
+++ rtir/branches/2.3-TESTING/t/016-date-due.t Mon Aug 11 21:06:44 2008
@@ -3,15 +3,8 @@
use strict;
use warnings;
-use Test::More tests => 13;
-
require "t/rtir-test.pl";
-
-use_ok('RT');
-RT::LoadConfig();
-RT::Init();
-
-use_ok('RT::IR');
+use Test::More tests => 14;
my $duty_a = RT::Test->load_or_create_user(
Name => 'duty a',
Modified: rtir/branches/2.3-TESTING/t/016-date-started.t
==============================================================================
--- rtir/branches/2.3-TESTING/t/016-date-started.t (original)
+++ rtir/branches/2.3-TESTING/t/016-date-started.t Mon Aug 11 21:06:44 2008
@@ -3,18 +3,15 @@
use strict;
use warnings;
-use Test::More tests => 69;
-
require "t/rtir-test.pl";
+use Test::More tests => 73;
-use_ok('RT');
-RT::LoadConfig();
-RT::Init();
+RT::Test->started_ok;
+my $agent = default_agent();
+use_ok('RT');
use_ok('RT::IR');
-
-my $agent = default_agent();
my $rtir_user = RT::CurrentUser->new( rtir_user() );
diag "started date of an investigation" if $ENV{'TEST_VERBOSE'};
Modified: rtir/branches/2.3-TESTING/t/019-watchers-on-create.t
==============================================================================
--- rtir/branches/2.3-TESTING/t/019-watchers-on-create.t (original)
+++ rtir/branches/2.3-TESTING/t/019-watchers-on-create.t Mon Aug 11 21:06:44 2008
@@ -1,11 +1,12 @@
+#!/usr/bin/perl
+
use strict;
use warnings;
-use Test::WWW::Mechanize;
-use Test::More tests => 50;
-
require "t/rtir-test.pl";
+use Test::More tests => 54;
+RT::Test->started_ok;
my $agent = default_agent();
my $ir = create_ir($agent, {Subject => 'IR to test watcher add bug',
Modified: rtir/branches/2.3-TESTING/t/019-webui-block-fields.t
==============================================================================
--- rtir/branches/2.3-TESTING/t/019-webui-block-fields.t (original)
+++ rtir/branches/2.3-TESTING/t/019-webui-block-fields.t Mon Aug 11 21:06:44 2008
@@ -1,10 +1,12 @@
-use strict;
+#!/usr/bin/perl
-use Test::WWW::Mechanize;
-use Test::More tests => 14;
+use strict;
+use warnings;
require "t/rtir-test.pl";
+use Test::More tests => 18;
+RT::Test->started_ok;
my $agent = default_agent();
my $incident = create_incident($agent, {Subject => 'Incident to test Block editing'});
Modified: rtir/branches/2.3-TESTING/t/020-incident-and-investigation.t
==============================================================================
--- rtir/branches/2.3-TESTING/t/020-incident-and-investigation.t (original)
+++ rtir/branches/2.3-TESTING/t/020-incident-and-investigation.t Mon Aug 11 21:06:44 2008
@@ -1,15 +1,15 @@
-# Tests the creation of inventory-and-investigation from an IR
+#!/usr/bin/perl
use strict;
-
-use Test::WWW::Mechanize;
-use Test::More tests => 22;
+use warnings;
require "t/rtir-test.pl";
-require RT::IR;
+use Test::More tests => 26;
+RT::Test->started_ok;
my $agent = default_agent();
+# Tests the creation of inventory-and-investigation from an IR
my $ir = create_ir($agent, {Subject => 'IR for testing creation of a linked Investigation with no correspondents'});
display_ticket($agent, $ir);
Modified: rtir/branches/2.3-TESTING/t/021-gnupg-on-create.t
==============================================================================
--- rtir/branches/2.3-TESTING/t/021-gnupg-on-create.t (original)
+++ rtir/branches/2.3-TESTING/t/021-gnupg-on-create.t Mon Aug 11 21:06:44 2008
@@ -3,29 +3,10 @@
use strict;
use warnings;
-use Test::More tests => 55;
-use File::Temp qw(tempdir);
-
-use lib qw(/opt/rt3/local/lib /opt/rt3/lib);
-require RT::Test; import RT::Test;
require "t/rtir-test.pl";
+use Test::More tests => 58;
-{
- $RT::Handle->InsertSchema(undef, '/opt/rt3/local/etc/FM');
- $RT::Handle->InsertACL(undef, '/opt/rt3/local/etc/FM');
-
- $RT::Handle = new RT::Handle;
- $RT::Handle->dbh( undef );
- RT->ConnectToDatabase;
-
- local @INC = ('/opt/rt3/local/etc', '/opt/rt3/etc', @INC);
- RT->Config->LoadConfig(File => "IR/RTIR_Config.pm");
- $RT::Handle->InsertData('IR/initialdata');
-
- $RT::Handle = new RT::Handle;
- $RT::Handle->dbh( undef );
- RT->ConnectToDatabase;
-}
+use File::Temp qw(tempdir);
RT::Test->set_mail_catcher;
@@ -42,10 +23,6 @@
RT->Config->Set( 'MailPlugins' => 'Auth::MailFrom', 'Auth::GnuPG' );
-RT->Config->Set( Plugins => 'RT::FM', 'RT::IR' );
-RT::InitPluginPaths();
-RT::InitPlugins();
-
my $queue = RT::Test->load_or_create_queue(
Name => 'Incident Reports',
CorrespondAddress => 'rt-recipient at example.com',
Modified: rtir/branches/2.3-TESTING/t/022-gnupg-on-update.t
==============================================================================
--- rtir/branches/2.3-TESTING/t/022-gnupg-on-update.t (original)
+++ rtir/branches/2.3-TESTING/t/022-gnupg-on-update.t Mon Aug 11 21:06:44 2008
@@ -3,29 +3,9 @@
use strict;
use warnings;
-use Test::More tests => 62;
-use File::Temp qw(tempdir);
-
-use lib qw(/opt/rt3/local/lib /opt/rt3/lib);
-require RT::Test; import RT::Test;
require "t/rtir-test.pl";
-
-{
- $RT::Handle->InsertSchema(undef, '/opt/rt3/local/etc/FM');
- $RT::Handle->InsertACL(undef, '/opt/rt3/local/etc/FM');
-
- $RT::Handle = new RT::Handle;
- $RT::Handle->dbh( undef );
- RT->ConnectToDatabase;
-
- local @INC = ('/opt/rt3/local/etc', '/opt/rt3/etc', @INC);
- RT->Config->LoadConfig(File => "IR/RTIR_Config.pm");
- $RT::Handle->InsertData('IR/initialdata');
-
- $RT::Handle = new RT::Handle;
- $RT::Handle->dbh( undef );
- RT->ConnectToDatabase;
-}
+use Test::More tests => 65;
+use File::Temp qw(tempdir);
RT::Test->set_mail_catcher;
@@ -43,8 +23,6 @@
RT->Config->Set( 'MailPlugins' => 'Auth::MailFrom', 'Auth::GnuPG' );
RT->Config->Set( Plugins => 'RT::FM', 'RT::IR' );
-RT::InitPluginPaths();
-RT::InitPlugins();
my $queue = RT::Test->load_or_create_queue(
Name => 'Incident Reports',
Modified: rtir/branches/2.3-TESTING/t/023-gnupg-on-incident.t
==============================================================================
--- rtir/branches/2.3-TESTING/t/023-gnupg-on-incident.t (original)
+++ rtir/branches/2.3-TESTING/t/023-gnupg-on-incident.t Mon Aug 11 21:06:44 2008
@@ -3,29 +3,9 @@
use strict;
use warnings;
-use Test::More tests => 36;
-use File::Temp qw(tempdir);
-
-use lib qw(/opt/rt3/local/lib /opt/rt3/lib);
-require RT::Test; import RT::Test;
require "t/rtir-test.pl";
-
-{
- $RT::Handle->InsertSchema(undef, '/opt/rt3/local/etc/FM');
- $RT::Handle->InsertACL(undef, '/opt/rt3/local/etc/FM');
-
- $RT::Handle = new RT::Handle;
- $RT::Handle->dbh( undef );
- RT->ConnectToDatabase;
-
- local @INC = ('/opt/rt3/local/etc', '/opt/rt3/etc', @INC);
- RT->Config->LoadConfig(File => "IR/RTIR_Config.pm");
- $RT::Handle->InsertData('IR/initialdata');
-
- $RT::Handle = new RT::Handle;
- $RT::Handle->dbh( undef );
- RT->ConnectToDatabase;
-}
+use Test::More tests => 39;
+use File::Temp qw(tempdir);
my @rights_backup = RT::Test->store_rights;
@@ -44,10 +24,6 @@
RT->Config->Set( 'MailPlugins' => 'Auth::MailFrom', 'Auth::GnuPG' );
-RT->Config->Set( 'Plugins' => 'RT::FM', 'RT::IR' );
-RT::InitPluginPaths();
-RT::InitPlugins();
-
my $queue = RT::Test->load_or_create_queue(
Name => 'Incident Reports',
CorrespondAddress => 'rt-recipient at example.com',
Modified: rtir/branches/2.3-TESTING/t/constituency/acl.t
==============================================================================
--- rtir/branches/2.3-TESTING/t/constituency/acl.t (original)
+++ rtir/branches/2.3-TESTING/t/constituency/acl.t Mon Aug 11 21:06:44 2008
@@ -3,8 +3,8 @@
use strict;
use warnings;
-use Test::More tests => 10;
require "t/rtir-test.pl";
+use Test::More tests => 13;
use_ok('RT::IR');
@@ -28,7 +28,6 @@
ok $queue_ir && $queue_ir->id, 'loaded or created queue';
# cleanup ACLs
-my @rights_backup = RT::Test->store_rights;
RT::Test->set_rights;
my $queue_ir_edunet = RT::Test->load_or_create_queue( Name => 'Incident Reports - EDUNET' );
@@ -48,6 +47,3 @@
ok $queue->CurrentUserHasRight('CreateTicket'), 'user has right';
ok $queue->CurrentUserHasRight('SeeQueue'), 'user has right';
}
-
-RT::Test->set_rights;
-RT::Test->restore_rights( @rights_backup );
Modified: rtir/branches/2.3-TESTING/t/constituency/basics.t
==============================================================================
--- rtir/branches/2.3-TESTING/t/constituency/basics.t (original)
+++ rtir/branches/2.3-TESTING/t/constituency/basics.t Mon Aug 11 21:06:44 2008
@@ -3,35 +3,11 @@
use strict;
use warnings;
-use Test::More tests => 172;
-
-use lib qw(/opt/rt3/local/lib /opt/rt3/lib);
-require RT::Test; import RT::Test;
require "t/rtir-test.pl";
-
-{
- $RT::Handle->InsertSchema(undef, '/opt/rt3/local/etc/FM');
- $RT::Handle->InsertACL(undef, '/opt/rt3/local/etc/FM');
-
- $RT::Handle = new RT::Handle;
- $RT::Handle->dbh( undef );
- RT->ConnectToDatabase;
-
- local @INC = ('/opt/rt3/local/etc', '/opt/rt3/etc', @INC);
- RT->Config->LoadConfig(File => "IR/RTIR_Config.pm");
- $RT::Handle->InsertData('IR/initialdata');
-
- $RT::Handle = new RT::Handle;
- $RT::Handle->dbh( undef );
- RT->ConnectToDatabase;
-}
+use Test::More tests => 175;
RT::Test->set_mail_catcher;
-RT->Config->Set( Plugins => 'RT::FM', 'RT::IR' );
-RT::InitPluginPaths();
-RT::InitPlugins();
-
use_ok('RT::IR');
my ($baseurl, $agent) = RT::Test->started_ok;
Modified: rtir/branches/2.3-TESTING/t/constituency/email.t
==============================================================================
--- rtir/branches/2.3-TESTING/t/constituency/email.t (original)
+++ rtir/branches/2.3-TESTING/t/constituency/email.t Mon Aug 11 21:06:44 2008
@@ -3,16 +3,12 @@
use strict;
use warnings;
-use Test::More tests => 62;
require "t/rtir-test.pl";
+use Test::More tests => 65;
# Test must be run wtih RT_SiteConfig:
# Set(@MailPlugins, 'Auth::MailFrom');
-use_ok('RT');
-RT::LoadConfig();
-RT::Init();
-
use_ok('RT::IR');
my $cf;
@@ -28,6 +24,7 @@
diag "get list of values" if $ENV{'TEST_VERBOSE'};
my @values = map $_->Name, @{ $cf->Values->ItemsArrayRef };
+RT::Test->started_ok;
my $agent = default_agent();
my $rtir_user = rtir_user();
Modified: rtir/branches/2.3-TESTING/t/constituency/email_outgoing.t
==============================================================================
--- rtir/branches/2.3-TESTING/t/constituency/email_outgoing.t (original)
+++ rtir/branches/2.3-TESTING/t/constituency/email_outgoing.t Mon Aug 11 21:06:44 2008
@@ -3,33 +3,8 @@
use strict;
use warnings;
-use Test::More tests => 33;
-
-use lib qw(/opt/rt3/local/lib /opt/rt3/lib);
-require RT::Test; import RT::Test;
require "t/rtir-test.pl";
-
-RT->Config->Set( 'Plugins' => 'RT::FM', 'RT::IR' );
-RT::InitPluginPaths();
-RT::InitPlugins();
-
-
-{
- $RT::Handle->InsertSchema(undef, '/opt/rt3/local/etc/FM');
- $RT::Handle->InsertACL(undef, '/opt/rt3/local/etc/FM');
-
- $RT::Handle = new RT::Handle;
- $RT::Handle->dbh( undef );
- RT->ConnectToDatabase;
-
- local @INC = ('/opt/rt3/local/etc', '/opt/rt3/etc', @INC);
- RT->Config->LoadConfig(File => "IR/RTIR_Config.pm");
- $RT::Handle->InsertData('IR/initialdata');
-
- $RT::Handle = new RT::Handle;
- $RT::Handle->dbh( undef );
- RT->ConnectToDatabase;
-}
+use Test::More tests => 36;
RT->Config->Set( '_RTIR_Constituency_default' => 'EDUNET' );
Modified: rtir/branches/2.3-TESTING/t/constituency/propagation-inherit.t
==============================================================================
--- rtir/branches/2.3-TESTING/t/constituency/propagation-inherit.t (original)
+++ rtir/branches/2.3-TESTING/t/constituency/propagation-inherit.t Mon Aug 11 21:06:44 2008
@@ -2,19 +2,12 @@
use strict;
use warnings;
-use Test::More;
require "t/rtir-test.pl";
-
-# XXX: we should use new RT::Test features and start server with
-# option we want.
-if ( RT->Config->Get('_RTIR_Constituency_Propagation') eq 'inherit' ) {
- plan tests => 196;
-} else {
- plan skip_all => 'constituency propagation algorithm is not "inherit"';
-}
+use Test::More tests => 200;
use_ok('RT::IR');
+RT->Config->Set('_RTIR_Constituency_Propagation' => 'inherit');
my $cf;
diag "load the field" if $ENV{'TEST_VERBOSE'};
@@ -26,6 +19,7 @@
ok $cf->id, 'with some ID';
}
+RT::Test->started_ok;
my $agent = default_agent();
my $rtir_user = rtir_user();
Modified: rtir/branches/2.3-TESTING/t/constituency/propagation-no.t
==============================================================================
--- rtir/branches/2.3-TESTING/t/constituency/propagation-no.t (original)
+++ rtir/branches/2.3-TESTING/t/constituency/propagation-no.t Mon Aug 11 21:06:44 2008
@@ -2,19 +2,12 @@
use strict;
use warnings;
-use Test::More;
require "t/rtir-test.pl";
-
-# XXX: we should use new RT::Test features and start server with
-# option we want.
-if ( RT->Config->Get('_RTIR_Constituency_Propagation') eq 'no' ) {
- plan tests => 109;
-} else {
- plan skip_all => 'constituency propagation algorithm is not "no"';
-}
+use Test::More tests => 113;
use_ok('RT::IR');
+RT->Config->Set('_RTIR_Constituency_Propagation' => 'no');
my $cf;
diag "load the field" if $ENV{'TEST_VERBOSE'};
@@ -26,6 +19,7 @@
ok $cf->id, 'with some ID';
}
+RT::Test->started_ok;
my $agent = default_agent();
my $rtir_user = rtir_user();
Modified: rtir/branches/2.3-TESTING/t/constituency/propagation-reject.t
==============================================================================
--- rtir/branches/2.3-TESTING/t/constituency/propagation-reject.t (original)
+++ rtir/branches/2.3-TESTING/t/constituency/propagation-reject.t Mon Aug 11 21:06:44 2008
@@ -2,19 +2,12 @@
use strict;
use warnings;
-use Test::More;
require "t/rtir-test.pl";
-
-# XXX: we should use new RT::Test features and start server with
-# option we want.
-if ( RT->Config->Get('_RTIR_Constituency_Propagation') eq 'reject' ) {
- plan tests => 200;
-} else {
- plan skip_all => 'constituency propagation algorithm is not "reject"';
-}
+use Test::More tests => 204;
use_ok('RT::IR');
+RT->Config->Set('_RTIR_Constituency_Propagation' => 'reject');
my $cf;
diag "load the field" if $ENV{'TEST_VERBOSE'};
@@ -26,6 +19,7 @@
ok $cf->id, 'with some ID';
}
+RT::Test->started_ok;
my $agent = default_agent();
my $rtir_user = rtir_user();
Modified: rtir/branches/2.3-TESTING/t/incident/abandon.t
==============================================================================
--- rtir/branches/2.3-TESTING/t/incident/abandon.t (original)
+++ rtir/branches/2.3-TESTING/t/incident/abandon.t Mon Aug 11 21:06:44 2008
@@ -3,11 +3,10 @@
use strict;
use warnings;
-use Test::More tests => 49;
require "t/rtir-test.pl";
+use Test::More tests => 52;
-use_ok('RT::IR');
-
+RT::Test->started_ok;
my $agent = default_agent();
diag "abandon unlinked incident" if $ENV{'TEST_VERBOSE'};
Modified: rtir/branches/2.3-TESTING/t/incident/bulk-abandon.t
==============================================================================
--- rtir/branches/2.3-TESTING/t/incident/bulk-abandon.t (original)
+++ rtir/branches/2.3-TESTING/t/incident/bulk-abandon.t Mon Aug 11 21:06:44 2008
@@ -1,10 +1,12 @@
-use strict;
+#!/usr/bin/perl
-use Test::WWW::Mechanize;
-use Test::More tests => 98;
+use strict;
+use warnings;
require "t/rtir-test.pl";
+use Test::More tests => 102;
+RT::Test->started_ok;
my $agent = default_agent();
my @ir_ids;
Modified: rtir/branches/2.3-TESTING/t/incident/split.t
==============================================================================
--- rtir/branches/2.3-TESTING/t/incident/split.t (original)
+++ rtir/branches/2.3-TESTING/t/incident/split.t Mon Aug 11 21:06:44 2008
@@ -2,10 +2,11 @@
use strict;
use warnings;
-use Test::More tests => 17;
require "t/rtir-test.pl";
+use Test::More tests => 21;
+RT::Test->started_ok;
my $agent = default_agent();
# Create some reports
Modified: rtir/branches/2.3-TESTING/t/lib/RT/IR/Test.pm
==============================================================================
--- rtir/branches/2.3-TESTING/t/lib/RT/IR/Test.pm (original)
+++ rtir/branches/2.3-TESTING/t/lib/RT/IR/Test.pm Mon Aug 11 21:06:44 2008
@@ -55,11 +55,12 @@
($ret, $msg) = $RT::Handle->InsertData('etc/initialdata');
Test::More::ok($ret,"Created ACL: ".($msg||''));
- #$RT::Handle->Connect;
+ $RT::Handle->Connect;
}
RT->Config->LoadConfig( File => 'RTIR_Config.pm' );
RT->Config->Set( 'rtirname' => 'regression_tests' );
+ require RT::IR;
}
1;
Modified: rtir/branches/2.3-TESTING/t/mail/skip_notification.t
==============================================================================
--- rtir/branches/2.3-TESTING/t/mail/skip_notification.t (original)
+++ rtir/branches/2.3-TESTING/t/mail/skip_notification.t Mon Aug 11 21:06:44 2008
@@ -3,36 +3,11 @@
use strict;
use warnings;
-use Test::More tests => 16;
-use File::Temp qw(tempdir);
-
-use lib qw(/opt/rt3/local/lib /opt/rt3/lib);
-require RT::Test; import RT::Test;
require "t/rtir-test.pl";
-
-{
- $RT::Handle->InsertSchema(undef, '/opt/rt3/local/etc/FM');
- $RT::Handle->InsertACL(undef, '/opt/rt3/local/etc/FM');
-
- $RT::Handle = new RT::Handle;
- $RT::Handle->dbh( undef );
- RT->ConnectToDatabase;
-
- local @INC = ('/opt/rt3/local/etc', '/opt/rt3/etc', @INC);
- RT->Config->LoadConfig(File => "IR/RTIR_Config.pm");
- $RT::Handle->InsertData('IR/initialdata');
-
- $RT::Handle = new RT::Handle;
- $RT::Handle->dbh( undef );
- RT->ConnectToDatabase;
-}
+use Test::More tests => 19;
RT->Config->Set( '_RTIR_Constituency_default' => 'EDUNET' );
-RT->Config->Set( 'Plugins' => 'RT::FM', 'RT::IR' );
-RT::InitPluginPaths();
-RT::InitPlugins();
-
RT::Test->set_mail_catcher;
my ($baseurl, $agent) = RT::Test->started_ok;
Modified: rtir/branches/2.3-TESTING/t/rtir-test.pl
==============================================================================
--- rtir/branches/2.3-TESTING/t/rtir-test.pl (original)
+++ rtir/branches/2.3-TESTING/t/rtir-test.pl Mon Aug 11 21:06:44 2008
@@ -9,20 +9,19 @@
use strict;
use warnings;
-use HTTP::Cookies;
-use Test::More;
-
### after: use lib qw(@RT_LIB_PATH@);
use lib qw(/opt/rt3/local/lib /opt/rt3/lib);
my $RTIR_TEST_USER = "rtir_test_user";
my $RTIR_TEST_PASS = "rtir_test_pass";
-require RT::Test;
+use lib 't/lib';
+use RT::IR::Test;
use RT::Test::Web;
sub default_agent {
my $agent = new RT::Test::Web;
+ require HTTP::Cookies;
$agent->cookie_jar( HTTP::Cookies->new );
rtir_user();
$agent->login($RTIR_TEST_USER, $RTIR_TEST_PASS);
@@ -69,13 +68,12 @@
my $agent = shift;
my $id = shift;
my $incs = shift;
- my $desc = shift;
display_ticket( $agent, $id );
foreach my $inc( ref $incs? @$incs : ($incs) ) {
my $desc = shift || "Ticket #$id is linked to the Incident #$inc";
$agent->content_like(
- qr{Incident:\s*</td>\s*<td[^>]*?>.*?\Q$inc:}ism,
- $desc || "Ticket #$id is linked to the Incident #$inc"
+ qr{Incident:\s*</td>\s*<td[^>]*?>.*?<a\s+href="/RTIR/Display.html\?id=\Q$inc\E">\Q$inc\E:\s+}ism,
+ $desc
) or return 0;
}
return 1;
@@ -85,13 +83,13 @@
my $agent = shift;
my $id = shift;
my $incs = shift;
- my $desc = shift;
display_ticket( $agent, $id );
foreach my $inc( @$incs ) {
- my $desc = shift || "Ticket #$id is linked to the Incident #$inc";
+ my $desc = shift || "Ticket #$id is not linked to the Incident #$inc";
+ diag $agent->content;
$agent->content_unlike(
- qr{Incident:\s*</td>\s*<td[^>]*?>.*?\Q$inc:}ism,
- $desc || "Ticket #$id is not linked to the Incident #$inc"
+ qr{Incident:\s*</td>\s*<td[^>]*?>.*?<a\s+href="/RTIR/Display.html\?id=\Q$inc\E">\Q$inc\E:\s+}ism,
+ $desc
) or return 0;
}
return 1;
More information about the Rt-commit
mailing list