[Rt-commit] r4926 - rtir/branches/1.9-EXPERIMENTAL/t
glasser at bestpractical.com
glasser at bestpractical.com
Fri Mar 31 11:27:56 EST 2006
Author: glasser
Date: Fri Mar 31 11:27:49 2006
New Revision: 4926
Modified:
rtir/branches/1.9-EXPERIMENTAL/t/001-basic-RTIR.t
rtir/branches/1.9-EXPERIMENTAL/t/002-test-reject.t
rtir/branches/1.9-EXPERIMENTAL/t/003-resolve-IR-when-all-incidents-resolved.t
rtir/branches/1.9-EXPERIMENTAL/t/rtir-test.pl
Log:
some test tweaks
Modified: rtir/branches/1.9-EXPERIMENTAL/t/001-basic-RTIR.t
==============================================================================
--- rtir/branches/1.9-EXPERIMENTAL/t/001-basic-RTIR.t (original)
+++ rtir/branches/1.9-EXPERIMENTAL/t/001-basic-RTIR.t Fri Mar 31 11:27:49 2006
@@ -14,8 +14,7 @@
my $report = create_ir($agent, {Subject => $SUBJECT, Content => "bla" });
{
- my $ir_obj = RT::Ticket->new($RT::SystemUser);
- my $stifle_warnings = $RT::SystemUser;
+ my $ir_obj = RT::Ticket->new(RT::SystemUser());
$ir_obj->Load($report);
is($ir_obj->Id, $report, "report has right ID");
Modified: rtir/branches/1.9-EXPERIMENTAL/t/002-test-reject.t
==============================================================================
--- rtir/branches/1.9-EXPERIMENTAL/t/002-test-reject.t (original)
+++ rtir/branches/1.9-EXPERIMENTAL/t/002-test-reject.t Fri Mar 31 11:27:49 2006
@@ -15,21 +15,21 @@
# We are testing that the reject and quick reject buttons both work
# both for IRs that you own and IRs that are unowned. So we make four IRs to work with.
-my $nobody_slow = create_ir($agent, {Subject => "nobody slow", Owner => $RT::Nobody->Id });
-my $nobody_quick = create_ir($agent, {Subject => "nobody quick", Owner => $RT::Nobody->Id });
+my $nobody_slow = create_ir($agent, {Subject => "nobody slow", Owner => RT::Nobody()->Id });
+my $nobody_quick = create_ir($agent, {Subject => "nobody quick", Owner => RT::Nobody()->Id });
my $me_slow = create_ir($agent, {Subject => "me slow", Owner => $rtir_user->Id });
my $me_quick = create_ir($agent, {Subject => "me quick", Owner => $rtir_user->Id });
for my $id ($nobody_slow, $nobody_quick) {
- my $ir_obj = RT::Ticket->new($RT::SystemUser);
+ my $ir_obj = RT::Ticket->new(RT::SystemUser());
$ir_obj->Load($id);
is($ir_obj->Id, $id, "report has right ID");
- is($ir_obj->Owner, $RT::Nobody->Id, "report owned by nobody");
+ is($ir_obj->Owner, RT::Nobody()->Id, "report owned by nobody");
}
for my $id ($me_slow, $me_quick) {
- my $ir_obj = RT::Ticket->new($RT::SystemUser);
+ my $ir_obj = RT::Ticket->new(RT::SystemUser());
$ir_obj->Load($id);
is($ir_obj->Id, $id, "report has right ID");
is($ir_obj->Owner, $rtir_user->Id, "report owned by me");
@@ -62,7 +62,7 @@
for my $id ($nobody_slow, $nobody_quick, $me_quick, $me_slow) {
- my $ir_obj = RT::Ticket->new($RT::SystemUser);
+ my $ir_obj = RT::Ticket->new(RT::SystemUser());
$ir_obj->Load($id);
is($ir_obj->Id, $id, "loaded ticket $id OK");
is($ir_obj->Status, 'rejected', "ticket $id is now rejected in DB");
Modified: rtir/branches/1.9-EXPERIMENTAL/t/003-resolve-IR-when-all-incidents-resolved.t
==============================================================================
--- rtir/branches/1.9-EXPERIMENTAL/t/003-resolve-IR-when-all-incidents-resolved.t (original)
+++ rtir/branches/1.9-EXPERIMENTAL/t/003-resolve-IR-when-all-incidents-resolved.t Fri Mar 31 11:27:49 2006
@@ -42,8 +42,7 @@
use DBIx::SearchBuilder::Record::Cachable;
DBIx::SearchBuilder::Record::Cachable::FlushCache();
- my $avoid_warnings = $RT::SystemUser;
- my $ir = RT::Ticket->new($RT::SystemUser);
+ my $ir = RT::Ticket->new(RT::SystemUser());
$ir->Load($ir_id);
is($ir->Id, $ir_id, "loaded ticket $ir_id OK");
is($ir->Status, $status, "ticket $ir_id has status $status");
Modified: rtir/branches/1.9-EXPERIMENTAL/t/rtir-test.pl
==============================================================================
--- rtir/branches/1.9-EXPERIMENTAL/t/rtir-test.pl (original)
+++ rtir/branches/1.9-EXPERIMENTAL/t/rtir-test.pl Fri Mar 31 11:27:49 2006
@@ -44,20 +44,21 @@
my $val = shift;
my $field_name = $agent->value($cf_name);
- diag("found $cf_name at $field_name");
+# diag("found $cf_name at $field_name");
$agent->field($field_name, $val);
}
sub go_home {
my $agent = shift;
- $agent->get_ok("$RT::WebURL/RTIR/index.html", "Loaded home page");
+ my $weburl = RT->Config->Get('WebURL');
+ $agent->get_ok("$weburl/RTIR/index.html", "Loaded home page");
}
sub log_in {
my $agent = shift;
if ($agent->title eq 'Login') {
- diag("logging in");
+# diag("logging in");
$agent->form_number(1);
$agent->field("user", $RTIR_TEST_USER);
$agent->field("pass", $RTIR_TEST_PASS);
@@ -87,7 +88,7 @@
ok($user_obj->Id > 0, "Successfully found the user");
- my $group_obj = RT::Group->new($RT::SystemUser);
+ my $group_obj = RT::Group->new(RT::SystemUser());
$group_obj->LoadUserDefinedGroup("DutyTeam");
ok($group_obj->Id > 0, "Successfully found the DutyTeam group");
@@ -96,7 +97,7 @@
}
sub rtir_user {
- my $u = RT::User->new($RT::SystemUser);
+ my $u = RT::User->new(RT::SystemUser());
$u->Load($RTIR_TEST_USER);
return $u;
}
@@ -168,7 +169,7 @@
ok ($agent->content =~ /.*Ticket (\d+) created in queue*/g, "Incident created from child $ir_id.");
my $incident_id = $1;
- diag("incident ID is $incident_id");
+# diag("incident ID is $incident_id");
return $incident_id;
}
More information about the Rt-commit
mailing list