[Rt-commit] r8273 - rtir/branches/2.3-EXPERIMENTAL/t

ruz at bestpractical.com ruz at bestpractical.com
Tue Jul 24 21:19:41 EDT 2007


Author: ruz
Date: Tue Jul 24 21:19:41 2007
New Revision: 8273

Modified:
   rtir/branches/2.3-EXPERIMENTAL/t/011-merge.t
   rtir/branches/2.3-EXPERIMENTAL/t/rtir-test.pl

Log:
* fix create_incident_and_investigation, was not returning IDs
* minor changes

Modified: rtir/branches/2.3-EXPERIMENTAL/t/011-merge.t
==============================================================================
--- rtir/branches/2.3-EXPERIMENTAL/t/011-merge.t	(original)
+++ rtir/branches/2.3-EXPERIMENTAL/t/011-merge.t	Tue Jul 24 21:19:41 2007
@@ -8,11 +8,12 @@
 
 my $agent = default_agent();
 
-{ # simple merge of IRs
+diag "simple merge of IRs" if $ENV{'TEST_VERBOSE'};
+{
     my $ir1_id = create_ir($agent, {Subject => "ir1 for merging"});
     my $ir2_id = create_ir($agent, {Subject => "ir2 for merging"});
-    display_ticket($agent, $ir2_id);
 
+    display_ticket($agent, $ir2_id);
     $agent->has_tag('a', 'Merge', 'we have Merge link');
     $agent->follow_link_ok({ text => 'Merge' }, "Followed merge link");
 
@@ -29,7 +30,9 @@
 
 }
 
-{ # merge an IR into a linked IR, the product should have open state
+diag "merge an IR into a linked IR, the product should have open state"
+    if $ENV{'TEST_VERBOSE'};
+{
     my $inc_id = create_incident($agent, {Subject => "base inc for merging"});
     my $ir1_id = create_ir($agent, {Subject => "ir1 for merging", Incident => $inc_id});
     ok_and_content_like($agent, qr{Incident:.*$inc_id}ms, 'Created linked IR');

Modified: rtir/branches/2.3-EXPERIMENTAL/t/rtir-test.pl
==============================================================================
--- rtir/branches/2.3-EXPERIMENTAL/t/rtir-test.pl	(original)
+++ rtir/branches/2.3-EXPERIMENTAL/t/rtir-test.pl	Tue Jul 24 21:19:41 2007
@@ -364,14 +364,19 @@
         set_custom_field($agent, $f, $v);
     }
     $agent->click("CreateWithInvestigation");
-    my $msg = $ir_id ? "Attempting to create new incident and investigation linked to child $ir_id" : "Attempting to create new incident and investigation";
+    my $msg = $ir_id
+        ? "Attempting to create new incident and investigation linked to child $ir_id"
+        : "Attempting to create new incident and investigation";
     is ($agent->status, 200, $msg);
 	$msg = $ir_id ? "Incident created from child $ir_id." : "Incident created.";
-    $agent->content_like(qr/.*Ticket (\d+) created in queue 'Incidents'/, $msg);
-  	my $incident_id = $1;
+
+    my $re = qr/.*Ticket (\d+) created in queue 'Incidents'/;
+    $agent->content_like( $re, $msg );
+  	my ($incident_id) = ($agent->content =~ $re);
   	
-    $agent->content_like(qr/.*Ticket (\d+) created in queue 'Investigations'/, "Investigation created for Incident $incident_id.");
-    my $investigation_id = $1;
+    $re = qr/.*Ticket (\d+) created in queue 'Investigations'/;
+    $agent->content_like( $re, "Investigation created for Incident $incident_id." );
+    my ($investigation_id) = ($agent->content =~ $re);
 
     return ($incident_id, $investigation_id);
 }


More information about the Rt-commit mailing list