[Rt-commit] [rtir] 12/22: make some test infrastructure constituency-aware

Jesse Vincent jesse at bestpractical.com
Sun Mar 29 02:51:01 EDT 2015


This is an automated email from the git hooks/post-receive script.

jesse pushed a commit to branch 3.4/remove_old_constituencies
in repository rtir.

commit a661bee242e5bde909a4bc29b8b91036d21f7efe
Author: Jesse Vincent <jesse at bestpractical.com>
Date:   Sat Mar 28 20:19:45 2015 -0700

    make some test infrastructure constituency-aware
---
 lib/RT/IR/Test/Web.pm              | 9 +++++----
 t/019-watchers-on-create.t         | 4 ++--
 t/020-incident-and-investigation.t | 2 +-
 t/constituency/basics.t            | 4 ++--
 4 files changed, 10 insertions(+), 9 deletions(-)

diff --git a/lib/RT/IR/Test/Web.pm b/lib/RT/IR/Test/Web.pm
index cea0c2e..6d40448 100644
--- a/lib/RT/IR/Test/Web.pm
+++ b/lib/RT/IR/Test/Web.pm
@@ -253,6 +253,7 @@ sub LinkChildToIncident {
 
 sub create_incident_and_investigation {
     my $self = shift;
+    my $constituency = shift;
     my $fields = shift || {};
     my $cfs = shift || {};
     my $ir_id = shift;
@@ -266,7 +267,7 @@ sub create_incident_and_investigation {
     }
     else 
     {
-        $self->goto_create_rtir_ticket('Incidents');
+        $self->goto_create_rtir_ticket('Incidents'.($constituency?' - '.$constituency : ''));
     }
 
     # Fill out forms
@@ -277,7 +278,7 @@ sub create_incident_and_investigation {
     }
 
     while (my ($f, $v) = each %$cfs) {
-        $self->set_custom_field( 'Incidents', $f, $v);
+        $self->set_custom_field( 'Incidents'.($constituency ? ' - '.$constituency:''), $f, $v);
     }
     $self->click("CreateWithInvestigation");
     my $msg = $ir_id
@@ -286,11 +287,11 @@ sub create_incident_and_investigation {
     Test::More::is ($self->status, 200, $msg);
     $msg = $ir_id ? "Incident created from child $ir_id." : "Incident created.";
 
-    my $re = qr/.*Ticket (\d+) created in queue 'Incidents'/;
+    my $re = qr/.*Ticket (\d+) created in queue 'Incidents/;
     $self->content_like( $re, $msg );
       my ($incident_id) = ($self->content =~ $re);
       
-    $re = qr/.*Ticket (\d+) created in queue 'Investigations'/;
+    $re = qr/.*Ticket (\d+) created in queue 'Investigations/;
     $self->content_like( $re, "Investigation created for Incident $incident_id." );
     my ($investigation_id) = ($self->content =~ $re);
 
diff --git a/t/019-watchers-on-create.t b/t/019-watchers-on-create.t
index d0c1c6b..2016c8d 100644
--- a/t/019-watchers-on-create.t
+++ b/t/019-watchers-on-create.t
@@ -24,7 +24,7 @@ SKIP: {
 
 
 	# Testing creating an incident and investigation from an Incident Report
-	my ($ir_inc, $ir_inv) = $agent->create_incident_and_investigation( 
+	my ($ir_inc, $ir_inv) = $agent->create_incident_and_investigation( '',
 		{Subject => "Incident linked with IR $ir to test adding watchers", 
 		InvestigationSubject => "Investigation linked with Incident to test adding watchers",
 		InvestigationRequestors => 'requestor at example.com',
@@ -48,7 +48,7 @@ SKIP: {
 
 
 # Testing creating an incident and investigation not from an incident report
-my ($inc, $inv) = $agent->create_incident_and_investigation( 
+my ($inc, $inv) = $agent->create_incident_and_investigation( '',
 	{Subject => "Incident to test adding watchers", 
 	InvestigationSubject => "Investigation linked to Incident to test adding watchers",
 	InvestigationRequestors => 'requestor at example.com',
diff --git a/t/020-incident-and-investigation.t b/t/020-incident-and-investigation.t
index d4a7dc4..aa470bb 100755
--- a/t/020-incident-and-investigation.t
+++ b/t/020-incident-and-investigation.t
@@ -34,7 +34,7 @@ $agent->display_ticket( $ir);
 
 # Okay, enough funny business. Now for some straightforward tests, how it should work
 {
-    my ($inc_id, $inv_id) = $agent->create_incident_and_investigation( 
+    my ($inc_id, $inv_id) = $agent->create_incident_and_investigation( '',
         {Subject => 'Incident for testing Incident-and-investigation-from-IR creation',
         InvestigationSubject => 'Investigation for testing Incident-and-Investigation-from-IR creation', 
         InvestigationRequestors => 'foo at example.com'}, {Classification => 'Spam', IP => '172.16.0.1'},
diff --git a/t/constituency/basics.t b/t/constituency/basics.t
index b94b3a0..59c095d 100644
--- a/t/constituency/basics.t
+++ b/t/constituency/basics.t
@@ -264,7 +264,7 @@ diag "check defaults";
 diag "check defaults when creating inc with inv";
 {
     $agent->login('govhandler', 'govhandler', logout => 1);
-	my ($inc_id, $inv_id) = $agent->create_incident_and_investigation(
+	my ($inc_id, $inv_id) = $agent->create_incident_and_investigation('GOVNET',
 	    {
             Subject => "Incident", 
 		    InvestigationSubject => "Investigation",
@@ -285,7 +285,7 @@ diag "check defaults when creating inc with inv";
 diag "check defaults when creating inc with inv";
 {
     $agent->login('eduhandler', 'eduhandler', logout => 1);
-	my ($inc_id, $inv_id) = $agent->create_incident_and_investigation(
+	my ($inc_id, $inv_id) = $agent->create_incident_and_investigation('EDUNET',
 	    {
             Subject => "Incident", 
 		    InvestigationSubject => "Investigation",

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.


More information about the rt-commit mailing list