[Rt-commit] r9497 - rtir/branches/2.3-EXPERIMENTAL/t/constituency

ruz at bestpractical.com ruz at bestpractical.com
Mon Oct 29 22:23:22 EDT 2007


Author: ruz
Date: Mon Oct 29 22:23:22 2007
New Revision: 9497

Modified:
   rtir/branches/2.3-EXPERIMENTAL/t/constituency/email.t

Log:
* improve tests
** to test setting constituency via email we must choose
   constituency value that is not default, otherwise we
   cab trap ourself


Modified: rtir/branches/2.3-EXPERIMENTAL/t/constituency/email.t
==============================================================================
--- rtir/branches/2.3-EXPERIMENTAL/t/constituency/email.t	(original)
+++ rtir/branches/2.3-EXPERIMENTAL/t/constituency/email.t	Mon Oct 29 22:23:22 2007
@@ -3,7 +3,7 @@
 use strict;
 use warnings;
 
-use Test::More tests => 61;
+use Test::More tests => 62;
 require "t/rtir-test.pl";
 
 # Test must be run wtih RT_SiteConfig:
@@ -25,6 +25,9 @@
     ok $cf->id, 'with some ID';
 }
 
+diag "get list of values" if $ENV{'TEST_VERBOSE'};
+my @values = map $_->Name, @{ $cf->Values->ItemsArrayRef };
+
 my $agent = default_agent();
 my $rtir_user = rtir_user();
 
@@ -60,6 +63,11 @@
 diag "create a ticket via gate using EXTENSION" if $ENV{'TEST_VERBOSE'};
 {
     my $i = 0;
+
+    my $default = RT->Config->Get('_RTIR_Constituency_default');
+    my $val = (grep lc($_) ne lc($default), @values)[0];
+    ok $val, 'find not default value';
+
     my $incident_id; # block couldn't be created without incident id
     foreach my $queue( 'Incidents', 'Incident Reports', 'Investigations', 'Blocks' ) {
         diag "create a ticket in the '$queue' queue" if $ENV{'TEST_VERBOSE'};
@@ -71,7 +79,6 @@
 
 Foob!
 EOF
-        my $val = 'GOVNET';
         local $ENV{'EXTENSION'} = $val;
         my ($status, $id) = RT::Test->send_via_mailgate($text, queue => $queue);
         is $status >> 8, 0, "The mail gateway exited ok";


More information about the Rt-commit mailing list