[Rt-commit] rt branch, ip-customfields, updated. rt-3.8.8-862-g46aa1f2
Shawn Moore
sartak at bestpractical.com
Tue Sep 21 16:59:01 EDT 2010
The branch, ip-customfields has been updated
via 46aa1f2342f46e78123fa74bb046bacb16dabfa4 (commit)
from a367be24104f101d631fa8657bafef7fb5b1d3a7 (commit)
Summary of changes:
t/customfields/ip.t | 27 ++++++++++++++++++++++++++-
1 files changed, 26 insertions(+), 1 deletions(-)
- Log -----------------------------------------------------------------
commit 46aa1f2342f46e78123fa74bb046bacb16dabfa4
Author: Shawn M Moore <sartak at bestpractical.com>
Date: Tue Sep 21 14:00:02 2010 -0700
Failing test for LIKE partial IP
diff --git a/t/customfields/ip.t b/t/customfields/ip.t
index cd91e49..9f38086 100644
--- a/t/customfields/ip.t
+++ b/t/customfields/ip.t
@@ -3,7 +3,7 @@
use strict;
use warnings;
-use RT::Test tests => 64;
+use RT::Test tests => 67;
my ( $baseurl, $agent ) = RT::Test->started_ok;
ok( $agent->login, 'log in' );
@@ -248,3 +248,28 @@ diag "create two tickets with different IPs and check several searches"
'192.168.22.10', "correct value" );
}
+diag "create a ticket with an IP of 10.0.0.1 and search for doesn't match '10.0.0.'."
+ if $ENV{'TEST_VERBOSE'};
+{
+ ok $agent->goto_create_ticket($q), "go to create ticket";
+ my $cf_field = "Object-RT::Ticket--CustomField-$cf_id-Values";
+ $agent->submit_form(
+ form_name => 'TicketCreate',
+ fields => {
+ Subject => 'local',
+ $cf_field => '10.0.0.1',
+ }
+ );
+
+ my ($id) = $agent->content =~ /Ticket (\d+) created/;
+ ok( $id, "created first ticket $id" );
+
+ my $tickets = RT::Tickets->new($RT::SystemUser);
+ $tickets->FromSQL("id=$id AND CF.{IP} NOT LIKE '10.0.0.'");
+
+ TODO: {
+ local $TODO = "the ticket is matched because we fail to parse '10.0.0.' as an IP address so it's not canonicalized to '010.000.000.' which is what we would need to do for LIKE";
+ is( $tickets->Count, 0, "should not have found the ticket" );
+ }
+}
+
-----------------------------------------------------------------------
More information about the Rt-commit
mailing list