X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=rt%2Ft%2Fcustomfields%2Fip.t;h=35a245c5e7040f02cd6e900e53d266b4c9b733c0;hb=1c538bfabc2cd31f27067505f0c3d1a46cba6ef0;hp=f73e63fa569c03f066b414237b611b74defb8b0c;hpb=6587f6ba7d047ddc1686c080090afe7d53365bd4;p=freeside.git diff --git a/rt/t/customfields/ip.t b/rt/t/customfields/ip.t index f73e63fa5..35a245c5e 100644 --- a/rt/t/customfields/ip.t +++ b/rt/t/customfields/ip.t @@ -1,9 +1,9 @@ -#!/usr/bin/perl use strict; use warnings; -use RT::Test tests => 73; +use RT::Test tests => undef; +use Test::Warn; my ( $baseurl, $agent ) = RT::Test->started_ok; ok( $agent->login, 'log in' ); @@ -26,7 +26,7 @@ my $cf; diag "load and check basic properties of the IP CF" if $ENV{'TEST_VERBOSE'}; { my $cfs = RT::CustomFields->new($RT::SystemUser); - $cfs->Limit( FIELD => 'Name', VALUE => 'IP' ); + $cfs->Limit( FIELD => 'Name', VALUE => 'IP', CASESENSITIVE => 0 ); is( $cfs->Count, 1, "found one CF with name 'IP'" ); $cf = $cfs->First; @@ -147,7 +147,7 @@ diag "check that we parse correct IPs only" if $ENV{'TEST_VERBOSE'}; } ); - $agent->content_contains( 'can not be parsed as an IP address', + $agent->content_contains( 'is not a valid IP address', 'ticket fails to create' ); } @@ -265,10 +265,12 @@ diag "create a ticket with an IP of 10.0.0.1 and search for doesn't match '10.0. 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.'"); + warning_like { + $tickets->FromSQL("id=$id AND CF.{IP} NOT LIKE '10.0.0.'"); + } [qr/not a valid IPAddress/], "caught warning about valid IP address"; - SKIP: { - skip "partical ip parse causes ambiguity", 1; + TODO: { + local $TODO = "partial ip parse causes ambiguity"; is( $tickets->Count, 0, "should not have found the ticket" ); } } @@ -279,7 +281,10 @@ diag "test the operators in search page" if $ENV{'TEST_VERBOSE'}; $agent->get_ok( $baseurl . "/Search/Build.html?Query=Queue='General'" ); $agent->content_contains('CF.{IP}', 'got CF.{IP}'); my $form = $agent->form_name('BuildQuery'); - my $op = $form->find_input("'CF.{IP}'Op"); - ok( $op, "found 'CF.{IP}'Op" ); + my $op = $form->find_input("CF.{IP}Op"); + ok( $op, "found CF.{IP}Op" ); is_deeply( [ $op->possible_values ], [ '=', '!=', '<', '>' ], 'op values' ); } + +undef $agent; +done_testing;