[Rt-commit] r5162 - in rtir/branches/1.9-EXPERIMENTAL: t

ruz at bestpractical.com ruz at bestpractical.com
Wed May 3 21:46:15 EDT 2006


Author: ruz
Date: Wed May  3 21:46:14 2006
New Revision: 5162

Modified:
   rtir/branches/1.9-EXPERIMENTAL/   (props changed)
   rtir/branches/1.9-EXPERIMENTAL/t/011-merge.t

Log:
 r1409 at cubic-pc:  cubic | 2006-05-04 05:53:30 +0400
 * more tests


Modified: rtir/branches/1.9-EXPERIMENTAL/t/011-merge.t
==============================================================================
--- rtir/branches/1.9-EXPERIMENTAL/t/011-merge.t	(original)
+++ rtir/branches/1.9-EXPERIMENTAL/t/011-merge.t	Wed May  3 21:46:14 2006
@@ -2,7 +2,7 @@
 
 use strict;
 use warnings;
-use Test::More qw(no_plan); #tests => 38;
+use Test::More tests => 116;
 
 require "t/rtir-test.pl";
 
@@ -58,7 +58,7 @@
     my $ir1_id = create_ir($agent, {Subject => "ir2 for merging"});
 
     my $inc_id = create_incident($agent, {Subject => "base inc for merging"});
-    my $ir2_id = create_ir($agent, {Subject => "ir1 for merging", Incident => $inc_id});
+    my $ir2_id = create_ir($agent, {Subject => "ir2 for merging", Incident => $inc_id});
     ok_and_content_like($agent, qr{Incident:.*$inc_id}ms, 'Created linked IR');
     ticket_state_is( $agent, $ir2_id, 'open' );
 
@@ -79,3 +79,23 @@
     ok_and_content_like($agent, qr{Incident Report #$ir2_id:}, 'Opened the merged ticket');
     ticket_state_is( $agent, $ir1_id, 'open' );
 }
+
+{ # merge two IRs that are linked to different Incidents
+    my $inc1_id = create_incident($agent, {Subject => "base inc1 for merging"});
+    my $ir1_id = create_ir($agent, {Subject => "ir1 for merging", Incident => $inc1_id});
+
+    my $inc2_id = create_incident($agent, {Subject => "base inc2 for merging"});
+    my $ir2_id = create_ir($agent, {Subject => "ir2 for merging", Incident => $inc2_id});
+
+    display_ticket($agent, $ir2_id);
+
+    $agent->has_tag('a', 'Merge', 'we have Merge link');
+    $agent->follow_link_ok({ text => 'Merge' }, "Followed merge link");
+
+    $agent->form_number(2);
+    $agent->field('SelectedTicket', $ir1_id);
+    $agent->submit;
+    ok_and_content_like($agent, qr{Merge Successful}, 'Merge Successful');
+
+    ticket_is_linked_to_inc( $agent, $ir1_id, [$inc1_id, $inc2_id] );
+}


More information about the Rt-commit mailing list