[Rt-commit] r8757 - in rtir/branches/2.3-EXPERIMENTAL: .

sartak at bestpractical.com sartak at bestpractical.com
Tue Aug 28 12:21:44 EDT 2007


Author: sartak
Date: Tue Aug 28 12:21:41 2007
New Revision: 8757

Modified:
   rtir/branches/2.3-EXPERIMENTAL/   (props changed)
   rtir/branches/2.3-EXPERIMENTAL/t/013-custom-field-ip.t

Log:
 r37471 at onn:  sartak | 2007-08-28 12:21:27 -0400
 Add (passing) tests for commas and semicolons separating IPs


Modified: rtir/branches/2.3-EXPERIMENTAL/t/013-custom-field-ip.t
==============================================================================
--- rtir/branches/2.3-EXPERIMENTAL/t/013-custom-field-ip.t	(original)
+++ rtir/branches/2.3-EXPERIMENTAL/t/013-custom-field-ip.t	Tue Aug 28 12:21:41 2007
@@ -2,7 +2,7 @@
 
 use strict;
 use warnings;
-use Test::More tests => 418;
+use Test::More tests => 430;
 
 require "t/rtir-test.pl";
 
@@ -319,6 +319,28 @@
     ok($has{'192.168.20.2'}, "IP is there");
 }
 
+diag "check IPs separated by commas and semicolons" if $ENV{'TEST_VERBOSE'};
+{
+    my $id = create_ir( $agent, {
+        Subject => "test ip",
+        Content => '64.64.64.64, 32.32.32.32; 16.16.16.16.'
+    } );
+    ok($id, "created first ticket");
+
+    my $ticket = RT::Ticket->new( $RT::SystemUser );
+    $ticket->Load( $id );
+    ok( $ticket->id, 'loaded ticket' );
+
+    my $values = $ticket->CustomFieldValues('_RTIR_IP');
+    my %has;
+    $has{ $_->Content }++ foreach @{ $values->ItemsArrayRef };
+    is(scalar values %has, 3, "three IPs were added");
+    ok(!grep( $_ != 1, values %has ), "no duplicated values");
+    ok($has{'64.64.64.64'}, "IP is there");
+    ok($has{'32.32.32.32'}, "IP is there");
+    ok($has{'16.16.16.16'}, "IP is there");
+}
+
 diag "search tickets by IP" if $ENV{'TEST_VERBOSE'};
 {
     my $id = create_ir( $agent, {


More information about the Rt-commit mailing list