summaryrefslogtreecommitdiff
path: root/rt/t/customfields/date_search.t
diff options
context:
space:
mode:
authorIvan Kohler <ivan@freeside.biz>2015-07-09 22:18:55 -0700
committerIvan Kohler <ivan@freeside.biz>2015-07-09 22:27:04 -0700
commite131b1f71f08b69abb832c1687d1f29682d171f8 (patch)
tree490167e41d9fe05b760e7b21a96ee35a86f8edda /rt/t/customfields/date_search.t
parentd05d7346bb2387fd9d0354923d577275c5c7f019 (diff)
RT 4.2.11, ticket#13852
Diffstat (limited to 'rt/t/customfields/date_search.t')
-rw-r--r--rt/t/customfields/date_search.t27
1 files changed, 26 insertions, 1 deletions
diff --git a/rt/t/customfields/date_search.t b/rt/t/customfields/date_search.t
index 2a8e6ce7a..e9a5a5e76 100644
--- a/rt/t/customfields/date_search.t
+++ b/rt/t/customfields/date_search.t
@@ -3,7 +3,7 @@ use Test::MockTime qw(set_fixed_time restore_time);
use warnings;
use strict;
-use RT::Test nodata => 1, tests => 21;
+use RT::Test nodata => 1, tests => undef;
RT::Test->set_rights(
{ Principal => 'Everyone', Right => [qw(
@@ -16,9 +16,11 @@ ok $q && $q->id, 'loaded or created a queue';
my $user_m = RT::Test->load_or_create_user( Name => 'moscow', Timezone => 'Europe/Moscow' );
ok $user_m && $user_m->id;
+$user_m = RT::CurrentUser->new( $user_m );
my $user_b = RT::Test->load_or_create_user( Name => 'boston', Timezone => 'America/New_York' );
ok $user_b && $user_b->id;
+$user_b = RT::CurrentUser->new( $user_b );
my $cf = RT::CustomField->new(RT->SystemUser);
ok(
@@ -132,6 +134,28 @@ is( $ticket->CustomFieldValues->First->Content, '2010-05-04', 'date in db is' );
is( $tickets->Count, 0, 'did not find the ticket with > 2010-05-05' );
}
+{
+ my $tickets = RT::Tickets->new(RT->SystemUser);
+ $tickets->LimitCustomField(
+ CUSTOMFIELD => $cf->id,
+ OPERATOR => 'IS',
+ VALUE => 'NULL',
+ );
+
+ is( $tickets->Count, 0, 'did not find the ticket with date IS NULL' );
+}
+
+{
+ my $tickets = RT::Tickets->new(RT->SystemUser);
+ $tickets->LimitCustomField(
+ CUSTOMFIELD => $cf->id,
+ OPERATOR => 'IS NOT',
+ VALUE => 'NULL',
+ );
+
+ is( $tickets->Count, 1, 'did find the ticket with date IS NOT NULL' );
+}
+
# relative search by users in different TZs
{
my $ticket = RT::Ticket->new(RT->SystemUser);
@@ -162,3 +186,4 @@ is( $ticket->CustomFieldValues->First->Content, '2010-05-04', 'date in db is' );
is( $tickets->Count, 1, 'found the tickets' );
}
+done_testing;