[Rt-commit] r13277 - in rt/branches/3.8-TESTING: .
elacour at bestpractical.com
elacour at bestpractical.com
Fri Jun 13 08:18:41 EDT 2008
Author: elacour
Date: Fri Jun 13 08:18:40 2008
New Revision: 13277
Modified:
rt/branches/3.8-TESTING/ (props changed)
rt/branches/3.8-TESTING/t/ticket/quicksearch.t
Log:
r9518 at datura: manu | 2008-06-13 14:18:34 +0200
Get active statuses from config file instead of hardcoding them.
Modified: rt/branches/3.8-TESTING/t/ticket/quicksearch.t
==============================================================================
--- rt/branches/3.8-TESTING/t/ticket/quicksearch.t (original)
+++ rt/branches/3.8-TESTING/t/ticket/quicksearch.t Fri Jun 13 08:18:40 2008
@@ -24,6 +24,9 @@
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);
@@ -31,9 +34,9 @@
"General new open root" => "( Owner = 'root' ) AND ( Queue = 'General' ) AND ( Status = 'new' OR Status = 'open' )",
"fulltext:jesse" => "( Content LIKE 'jesse' )",
$queue => "( Queue = '$queue' )",
- "root $queue" => "( Owner = 'root' ) AND ( Queue = '$queue' ) AND ( Status = 'new' OR Status = 'open' OR Status = 'stalled' )",
+ "root $queue" => "( Owner = 'root' ) AND ( Queue = '$queue' ) AND ( $active_statuses )",
"notauser $queue" => "( Queue = '$queue' ) AND ( Subject LIKE 'notauser' )",
- "notauser $queue root" => "( Owner = 'root' ) AND ( Queue = '$queue' ) AND ( Status = 'new' OR Status = 'open' OR Status = 'stalled' ) 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>");
More information about the Rt-commit
mailing list