[Rt-commit] r20011 - rtir/2.5/trunk/t/constituency

sunnavy at bestpractical.com sunnavy at bestpractical.com
Wed Jun 17 21:57:42 EDT 2009


Author: sunnavy
Date: Wed Jun 17 21:57:41 2009
New Revision: 20011

Modified:
   rtir/2.5/trunk/t/constituency/basics.t
   rtir/2.5/trunk/t/constituency/email_outgoing.t
   rtir/2.5/trunk/t/constituency/propagation-inherit.t
   rtir/2.5/trunk/t/constituency/propagation-no.t
   rtir/2.5/trunk/t/constituency/propagation-reject.t

Log:
go on the conversion of sub => method

Modified: rtir/2.5/trunk/t/constituency/basics.t
==============================================================================
--- rtir/2.5/trunk/t/constituency/basics.t	(original)
+++ rtir/2.5/trunk/t/constituency/basics.t	Wed Jun 17 21:57:41 2009
@@ -3,7 +3,7 @@
 use strict;
 use warnings;
 
-use RT::IR::Test tests => 175;
+use RT::IR::Test tests => 176;
 
 RT::Test->set_mail_catcher;
 
@@ -76,8 +76,8 @@
         diag "create a ticket in the '$queue' queue" if $ENV{'TEST_VERBOSE'};
 
         my $val = 'GOVNET';
-        my $id = create_rtir_ticket_ok(
-            $agent, $queue,
+        my $id = $agent->create_rtir_ticket_ok(
+            $queue,
             { Subject => "test ip" },
             { Constituency => $val },
         );
@@ -164,8 +164,8 @@
 
 
     my $val = 'EDUNET';
-    my $ir_id = create_ir(
-        $agent, { Subject => "test" }, { Constituency => $val }
+    my $ir_id = $agent->create_ir(
+        { Subject => "test" }, { Constituency => $val }
     );
     ok( $ir_id, "created IR #$ir_id" );
     $agent->display_ticket( $ir_id);
@@ -247,8 +247,8 @@
 diag "check defaults";
 {
     $agent->login('eduhandler', 'eduhandler');
-    my $ir_id = create_ir(
-        $agent, { Subject => "test" },
+    my $ir_id = $agent->create_ir(
+        { Subject => "test" },
     );
     my $ticket = RT::Ticket->new($RT::SystemUser);
     $ticket->Load($ir_id);
@@ -258,8 +258,8 @@
 diag "check defaults";
 {
     $agent->login('govhandler', 'govhandler');
-    my $ir_id = create_ir(
-        $agent, { Subject => "test" },
+    my $ir_id = $agent->create_ir(
+        { Subject => "test" },
     );
     my $ticket = RT::Ticket->new($RT::SystemUser);
     $ticket->Load($ir_id);
@@ -269,8 +269,7 @@
 diag "check defaults when creating inc with inv";
 {
     $agent->login('govhandler', 'govhandler');
-	my ($inc_id, $inv_id) = create_incident_and_investigation(
-        $agent, 
+	my ($inc_id, $inv_id) = $agent->create_incident_and_investigation(
 	    {
             Subject => "Incident", 
 		    InvestigationSubject => "Investigation",
@@ -291,8 +290,7 @@
 diag "check defaults when creating inc with inv";
 {
     $agent->login('eduhandler', 'eduhandler');
-	my ($inc_id, $inv_id) = create_incident_and_investigation(
-        $agent, 
+	my ($inc_id, $inv_id) = $agent->create_incident_and_investigation(
 	    {
             Subject => "Incident", 
 		    InvestigationSubject => "Investigation",

Modified: rtir/2.5/trunk/t/constituency/email_outgoing.t
==============================================================================
--- rtir/2.5/trunk/t/constituency/email_outgoing.t	(original)
+++ rtir/2.5/trunk/t/constituency/email_outgoing.t	Wed Jun 17 21:57:41 2009
@@ -134,8 +134,8 @@
     RT::Test->clean_caught_mails;
 
     $agent->login('govhandler', 'govhandler');
-    my $id = create_ir(
-        $agent,
+    my $id = $agent->create_ir(
+        
         { Subject => "test", Requestors => $rtir_user->EmailAddress },
         { Constituency => 'EDUNET' },
     );

Modified: rtir/2.5/trunk/t/constituency/propagation-inherit.t
==============================================================================
--- rtir/2.5/trunk/t/constituency/propagation-inherit.t	(original)
+++ rtir/2.5/trunk/t/constituency/propagation-inherit.t	Wed Jun 17 21:57:41 2009
@@ -26,14 +26,14 @@
     . "incident for the IR, we want it to inherit by default"
         if $ENV{'TEST_VERBOSE'};
 {
-    my $ir_id = create_ir(
-        $agent, { Subject => "test" }, { Constituency => 'GOVNET' }
+    my $ir_id = $agent->create_ir(
+         { Subject => "test" }, { Constituency => 'GOVNET' }
     );
     ok $ir_id, "created IR #$ir_id";
     $agent->display_ticket( $ir_id);
 
-    my $inc_id = create_incident_for_ir(
-        $agent, $ir_id, { Subject => "test" },
+    my $inc_id = $agent->create_incident_for_ir(
+         $ir_id, { Subject => "test" },
     );
 
     my $ticket = RT::Ticket->new( $RT::SystemUser );
@@ -47,8 +47,8 @@
     ." value during creation of new linked incident" if $ENV{'TEST_VERBOSE'};
 {
     # create an IR
-    my $ir_id = create_ir(
-        $agent, { Subject => "test" }, { Constituency => 'GOVNET' }
+    my $ir_id = $agent->create_ir(
+         { Subject => "test" }, { Constituency => 'GOVNET' }
     );
     ok $ir_id, "created ticket #$ir_id";
     $agent->display_ticket( $ir_id);
@@ -70,7 +70,7 @@
     DBIx::SearchBuilder::Record::Cachable::FlushCache();
 
     # Incident has the same value 
-    my $inc_id = get_ticket_id( $agent );
+    my $inc_id = $agent->get_ticket_id();
     $ticket = RT::Ticket->new( $RT::SystemUser );
     $ticket->Load( $inc_id );
     ok $ticket->id, 'loaded ticket';
@@ -91,8 +91,8 @@
     . " incident's constituency is prefered even if another value's been selected"
         if $ENV{'TEST_VERBOSE'};
 {
-    my $incident_id = create_rtir_ticket_ok(
-        $agent, 'Incidents',
+    my $incident_id = $agent->create_rtir_ticket_ok(
+         'Incidents',
         { Subject => "test" },
         { Constituency => 'EDUNET' },
     );
@@ -107,8 +107,8 @@
     foreach my $queue( 'Incident Reports', 'Investigations', 'Blocks' ) {
         diag "create a ticket in the '$queue' queue" if $ENV{'TEST_VERBOSE'};
 
-        my $id = create_rtir_ticket_ok(
-            $agent, $queue,
+        my $id = $agent->create_rtir_ticket_ok(
+             $queue,
             {
                 Subject => "test constituency",
                 Incident => $incident_id,
@@ -141,12 +141,12 @@
     foreach my $queue( 'Incident Reports', 'Investigations', 'Blocks' ) {
         diag "create an incident for linking" if $ENV{'TEST_VERBOSE'};
 
-        my $incident_id = create_rtir_ticket_ok(
-            $agent, 'Incidents', { Subject => "test" }, { Constituency => 'GOVNET' },
+        my $incident_id = $agent->create_rtir_ticket_ok(
+             'Incidents', { Subject => "test" }, { Constituency => 'GOVNET' },
         );
         diag "create a ticket in the '$queue' queue" if $ENV{'TEST_VERBOSE'};
-        my $child_id = create_rtir_ticket_ok(
-            $agent, $queue,
+        my $child_id = $agent->create_rtir_ticket_ok(
+             $queue,
             {
                 Subject => "test constituency",
                 Incident => $incident_id,
@@ -227,12 +227,12 @@
     foreach my $queue( 'Incident Reports', 'Investigations' ) {
         diag "create an incident for linking" if $ENV{'TEST_VERBOSE'};
 
-        my $incident_id = create_rtir_ticket_ok(
-            $agent, 'Incidents', { Subject => "test" }, { Constituency => 'EDUNET' },
+        my $incident_id = $agent->create_rtir_ticket_ok(
+             'Incidents', { Subject => "test" }, { Constituency => 'EDUNET' },
         );
         diag "create a ticket in the '$queue' queue" if $ENV{'TEST_VERBOSE'};
-        my $child_id = create_rtir_ticket_ok(
-            $agent, $queue,
+        my $child_id = $agent->create_rtir_ticket_ok(
+             $queue,
             { Subject => "test constituency" },
             { Constituency => 'GOVNET' },
         );

Modified: rtir/2.5/trunk/t/constituency/propagation-no.t
==============================================================================
--- rtir/2.5/trunk/t/constituency/propagation-no.t	(original)
+++ rtir/2.5/trunk/t/constituency/propagation-no.t	Wed Jun 17 21:57:41 2009
@@ -26,8 +26,8 @@
     . " constituency shouldn't propagate back to tickets"
     if $ENV{'TEST_VERBOSE'};
 {
-    my $incident_id = create_rtir_ticket_ok(
-        $agent, 'Incidents',
+    my $incident_id = $agent->create_rtir_ticket_ok(
+        'Incidents',
         { Subject => "test" },
         { Constituency => 'EDUNET' },
     );
@@ -42,8 +42,8 @@
     foreach my $queue( 'Incident Reports', 'Investigations', 'Blocks' ) {
         diag "create a ticket in the '$queue' queue" if $ENV{'TEST_VERBOSE'};
 
-        my $id = create_rtir_ticket_ok(
-            $agent, $queue,
+        my $id = $agent->create_rtir_ticket_ok(
+            $queue,
             {
                 Subject => "test ip",
                 Incident => $incident_id,
@@ -106,14 +106,14 @@
     . "incident for the IR, we want it to inherit"
         if $ENV{'TEST_VERBOSE'};
 {
-    my $ir_id = create_ir(
-        $agent, { Subject => "test" }, { Constituency => 'GOVNET' }
+    my $ir_id = $agent->create_ir(
+        { Subject => "test" }, { Constituency => 'GOVNET' }
     );
     ok $ir_id, "created IR #$ir_id";
     $agent->display_ticket( $ir_id);
 
-    my $inc_id = create_incident_for_ir(
-        $agent, $ir_id, { Subject => "test" },
+    my $inc_id = $agent->create_incident_for_ir(
+        $ir_id, { Subject => "test" },
     );
 
     my $ticket = RT::Ticket->new( $RT::SystemUser );
@@ -126,14 +126,14 @@
 diag "inheritance should be soft, so user can change constituency using ui"
         if $ENV{'TEST_VERBOSE'};
 {
-    my $ir_id = create_ir(
-        $agent, { Subject => "test" }, { Constituency => 'GOVNET' }
+    my $ir_id = $agent->create_ir(
+        { Subject => "test" }, { Constituency => 'GOVNET' }
     );
     ok $ir_id, "created IR #$ir_id";
     $agent->display_ticket( $ir_id);
 
-    my $inc_id = create_incident_for_ir(
-        $agent, $ir_id, { Subject => "test" }, { Constituency => 'EDUNET' }
+    my $inc_id = $agent->create_incident_for_ir(
+        $ir_id, { Subject => "test" }, { Constituency => 'EDUNET' }
     );
 
     my $ticket = RT::Ticket->new( $RT::SystemUser );
@@ -149,8 +149,8 @@
 {
     diag "first of all create the incident" if $ENV{'TEST_VERBOSE'};
 
-    my $inc_id = create_incident(
-        $agent, { Subject => "test" }, { Constituency => 'GOVNET' }
+    my $inc_id = $agent->create_incident(
+        { Subject => "test" }, { Constituency => 'GOVNET' }
     );
     ok( $inc_id, "created ticket #$inc_id" );
     $agent->display_ticket( $inc_id );
@@ -166,8 +166,8 @@
     }
 
     diag "then create the report" if $ENV{'TEST_VERBOSE'};
-    my $ir_id = create_ir(
-        $agent, { Subject => "test", Incident => $inc_id }, { Constituency => 'EDUNET' },
+    my $ir_id = $agent->create_ir(
+        { Subject => "test", Incident => $inc_id }, { Constituency => 'EDUNET' },
     );
     $agent->ticket_is_linked_to_inc( $ir_id => $inc_id );
     DBIx::SearchBuilder::Record::Cachable::FlushCache();

Modified: rtir/2.5/trunk/t/constituency/propagation-reject.t
==============================================================================
--- rtir/2.5/trunk/t/constituency/propagation-reject.t	(original)
+++ rtir/2.5/trunk/t/constituency/propagation-reject.t	Wed Jun 17 21:57:41 2009
@@ -26,14 +26,14 @@
     . "incident for the IR, we want it to inherit by default"
         if $ENV{'TEST_VERBOSE'};
 {
-    my $ir_id = create_ir(
-        $agent, { Subject => "test" }, { Constituency => 'GOVNET' }
+    my $ir_id = $agent->create_ir(
+        { Subject => "test" }, { Constituency => 'GOVNET' }
     );
     ok $ir_id, "created IR #$ir_id";
     $agent->display_ticket( $ir_id);
 
-    my $inc_id = create_incident_for_ir(
-        $agent, $ir_id, { Subject => "test" },
+    my $inc_id = $agent->create_incident_for_ir(
+        $ir_id, { Subject => "test" },
     );
 
     my $ticket = RT::Ticket->new( $RT::SystemUser );
@@ -47,8 +47,8 @@
     ." value during creation of new linked incident" if $ENV{'TEST_VERBOSE'};
 {
     # create an IR
-    my $ir_id = create_ir(
-        $agent, { Subject => "test" }, { Constituency => 'GOVNET' }
+    my $ir_id = $agent->create_ir(
+        { Subject => "test" }, { Constituency => 'GOVNET' }
     );
     ok $ir_id, "created ticket #$ir_id";
     $agent->display_ticket( $ir_id);
@@ -69,7 +69,7 @@
     DBIx::SearchBuilder::Record::Cachable::FlushCache();
 
     # Incident has the same value 
-    my $inc_id = get_ticket_id( $agent );
+    my $inc_id = $agent->get_ticket_id( );
     $ticket = RT::Ticket->new( $RT::SystemUser );
     $ticket->Load( $inc_id );
     ok $ticket->id, 'loaded ticket';
@@ -90,8 +90,8 @@
     ." Incident input field and different constituency. Should be rejected."
         if $ENV{'TEST_VERBOSE'};
 {
-    my $incident_id = create_rtir_ticket_ok(
-        $agent, 'Incidents',
+    my $incident_id = $agent->create_rtir_ticket_ok(
+        'Incidents',
         { Subject => "test" },
         { Constituency => 'EDUNET' },
     );
@@ -106,8 +106,8 @@
     foreach my $queue( 'Incident Reports', 'Investigations', 'Blocks' ) {
         diag "create a ticket in the '$queue' queue" if $ENV{'TEST_VERBOSE'};
 
-        my $id = create_rtir_ticket(
-            $agent, $queue,
+        my $id = $agent->create_rtir_ticket(
+            $queue,
             {
                 Subject => "test constituency",
                 Incident => $incident_id,
@@ -126,8 +126,8 @@
     . " with the same constituency and operation is not rejected"
         if $ENV{'TEST_VERBOSE'};
 {
-    my $incident_id = create_rtir_ticket_ok(
-        $agent, 'Incidents',
+    my $incident_id = $agent->create_rtir_ticket_ok(
+        'Incidents',
         { Subject => "test" },
         { Constituency => 'EDUNET' },
     );
@@ -142,8 +142,8 @@
     foreach my $queue( 'Incident Reports', 'Investigations', 'Blocks' ) {
         diag "create a ticket in the '$queue' queue" if $ENV{'TEST_VERBOSE'};
 
-        my $id = create_rtir_ticket_ok(
-            $agent, $queue,
+        my $id = $agent->create_rtir_ticket_ok(
+            $queue,
             {
                 Subject => "test constituency",
                 Incident => $incident_id,
@@ -176,8 +176,8 @@
         if $ENV{'TEST_VERBOSE'};
 {
     # an IR
-    my $ir_id = create_ir(
-        $agent, { Subject => "test" }, { Constituency => 'GOVNET' }
+    my $ir_id = $agent->create_ir(
+        { Subject => "test" }, { Constituency => 'GOVNET' }
     );
     $agent->display_ticket( $ir_id);
     $agent->content_like( qr/GOVNET/, "value on the page" );
@@ -192,8 +192,8 @@
     }
 
     # an IR
-    my $inc_id = create_incident(
-        $agent, { Subject => "test" }, { Constituency => 'EDUNET' }
+    my $inc_id = $agent->create_incident(
+        { Subject => "test" }, { Constituency => 'EDUNET' }
     );
     $agent->display_ticket( $inc_id);
     $agent->content_like( qr/EDUNET/, "value on the page" );
@@ -218,8 +218,8 @@
 {
     # blocks are always linked to an incident
     foreach my $queue( 'Incidents', 'Incident Reports', 'Investigations' ) {
-        my $id = create_rtir_ticket_ok(
-            $agent, $queue,
+        my $id = $agent->create_rtir_ticket_ok(
+            $queue,
             { Subject => "test constituency" },
             { Constituency => 'GOVNET' },
         );
@@ -254,8 +254,8 @@
 diag "check that we can change constituency of an unlinked ticket using 'Edit' page"
     if $ENV{'TEST_VERBOSE'};
 {
-    my $incident_id = create_rtir_ticket_ok(
-        $agent, 'Incidents',
+    my $incident_id = $agent->create_rtir_ticket_ok(
+        'Incidents',
         { Subject => "test" },
         { Constituency => 'EDUNET' },
     );
@@ -268,8 +268,8 @@
     }
 
     foreach my $queue( 'Blocks', 'Incident Reports', 'Investigations' ) {
-        my $id = create_rtir_ticket_ok(
-            $agent, $queue,
+        my $id = $agent->create_rtir_ticket_ok(
+            $queue,
             {
                 Subject => "test constituency",
                 Incident => $incident_id,


More information about the Rt-commit mailing list