[Rt-commit] r5276 - in rtir/branches/1.9-EXPERIMENTAL: t
ruz at bestpractical.com
ruz at bestpractical.com
Mon May 22 09:19:25 EDT 2006
Author: ruz
Date: Mon May 22 09:19:24 2006
New Revision: 5276
Added:
rtir/branches/1.9-EXPERIMENTAL/t/012-split-incident.t
Modified:
rtir/branches/1.9-EXPERIMENTAL/ (props changed)
rtir/branches/1.9-EXPERIMENTAL/t/rtir-test.pl
Log:
r1427 at cubic-pc: cubic | 2006-05-22 17:06:43 +0400
* incident split + investigation launch tests
Added: rtir/branches/1.9-EXPERIMENTAL/t/012-split-incident.t
==============================================================================
--- (empty file)
+++ rtir/branches/1.9-EXPERIMENTAL/t/012-split-incident.t Mon May 22 09:19:24 2006
@@ -0,0 +1,39 @@
+#!/usr/bin/perl
+
+use strict;
+use warnings;
+use Test::More tests => 19;
+
+require "t/rtir-test.pl";
+
+my $agent = default_agent();
+
+# Create some reports
+
+my $rtir_user = rtir_user();
+
+# regression: split an inc, launch an inv on the new inc => the inv is linked
+# to both incidents, which is wrong, should be linked to one only
+{
+ my $id = create_incident($agent, {Subject => "split incident"});
+ display_ticket($agent, $id);
+ $agent->follow_link_ok({text => "Split"}, "Followed link");
+ $agent->form_number(2);
+ $agent->click('CreateIncident');
+ is ($agent->status, 200, "Attempted to create the ticket");
+ my $new_id = ($agent->content =~ /.*Ticket (\d+) created.*/i )[0];
+ ok ($new_id, "Ticket created successfully: #$new_id.");
+
+ $agent->follow_link_ok({text => "Launch"}, "Followed link");
+ $agent->form_number(2);
+ $agent->field('Requestors', $rtir_user->EmailAddress);
+ $agent->click('Create');
+
+ is ($agent->status, 200, "Attempted to create the ticket");
+ my $inv_id = ($agent->content =~ /.*Ticket (\d+) created.*/i )[0];
+ ok ($inv_id, "Ticket created successfully: #$inv_id.");
+
+ ticket_is_linked_to_inc($agent, $inv_id, [$new_id]);
+ ticket_is_not_linked_to_inc($agent, $inv_id, [$id]);
+}
+
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 Mon May 22 09:19:24 2006
@@ -93,6 +93,22 @@
return 1;
}
+sub ticket_is_not_linked_to_inc {
+ 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";
+ $agent->content_unlike(
+ qr{Incident:\s*</td>\s*<td[^>]*?>.*?\Q$inc:}ism,
+ $desc || "Ticket #$id is not linked to the Incident #$inc"
+ ) or return 0;
+ }
+ return 1;
+}
+
sub create_user {
my $user_obj = rtir_user();
More information about the Rt-commit
mailing list