diff options
author | ivan <ivan> | 2009-12-31 13:16:41 +0000 |
---|---|---|
committer | ivan <ivan> | 2009-12-31 13:16:41 +0000 |
commit | 63a268637b2d51a8766412617724b9436439deb6 (patch) | |
tree | a50f6d4c7829d5c80905e989144317192a44dc90 /rt/t/ticket/quicksearch.t | |
parent | 65a561e3cd8c1ba94f6282f5d2a1cd9783afbd21 (diff) | |
parent | b4b0c7e72d7eaee2fbfc7022022c9698323203dd (diff) |
This commit was generated by cvs2svn to compensate for changes in r8690,
which included commits to RCS files with non-trunk default branches.
Diffstat (limited to 'rt/t/ticket/quicksearch.t')
-rw-r--r-- | rt/t/ticket/quicksearch.t | 41 |
1 files changed, 41 insertions, 0 deletions
diff --git a/rt/t/ticket/quicksearch.t b/rt/t/ticket/quicksearch.t new file mode 100644 index 000000000..9ab9f21e4 --- /dev/null +++ b/rt/t/ticket/quicksearch.t @@ -0,0 +1,41 @@ + +#!/usr/bin/perl -w + +use strict; +use warnings; + +use RT::Test tests => 10; +use_ok('RT'); + + +my $q = RT::Queue->new($RT::SystemUser); +my $queue = 'SearchTests-'.$$; +$q->Create(Name => $queue); +ok ($q->id, "Created the queue"); + +my $t1 = RT::Ticket->new($RT::SystemUser); +my ( $id, undef, $msg ) = $t1->Create( + Queue => $q->id, + Subject => 'SearchTest1', + Requestor => ['search2@example.com'], +); +ok( $id, $msg ); + +use_ok("RT::Search::Googleish"); + +my $active_statuses = join( " OR ", map "Status = '$_'", RT::Queue->ActiveStatusArray()); + +my $tickets = RT::Tickets->new($RT::SystemUser); +my $quick = RT::Search::Googleish->new(Argument => "", + TicketsObj => $tickets); +my @tests = ( + "General new open root" => "( Owner = 'root' ) AND ( Queue = 'General' ) AND ( Status = 'new' OR Status = 'open' )", + "fulltext:jesse" => "( Content LIKE 'jesse' ) AND ( $active_statuses )", + $queue => "( Queue = '$queue' ) AND ( $active_statuses )", + "root $queue" => "( Owner = 'root' ) AND ( Queue = '$queue' ) AND ( $active_statuses )", + "notauser $queue" => "( Queue = '$queue' ) AND ( $active_statuses ) AND ( Subject LIKE 'notauser' )", + "notauser $queue root" => "( Owner = 'root' ) AND ( Queue = '$queue' ) AND ( $active_statuses ) AND ( Subject LIKE 'notauser' )"); + +while (my ($from, $to) = splice @tests, 0, 2) { + is($quick->QueryToSQL($from), $to, "<$from> -> <$to>"); +} |