[Rt-commit] rt branch, 4.2/simple-search, updated. rt-4.2.3-89-g5378f77
Alex Vandiver
alexmv at bestpractical.com
Fri Apr 18 19:21:04 EDT 2014
The branch, 4.2/simple-search has been updated
via 5378f773aec6944f9564a1b2906692aefa9dd32c (commit)
from 6b44a58c09f10d1e9b5b19b87917d87a9174a25f (commit)
Summary of changes:
t/ticket/simple_search.t | 4 ++--
t/web/simple_search.t | 19 ++++++++++---------
2 files changed, 12 insertions(+), 11 deletions(-)
- Log -----------------------------------------------------------------
commit 5378f773aec6944f9564a1b2906692aefa9dd32c
Author: Alex Vandiver <alexmv at bestpractical.com>
Date: Fri Apr 18 19:20:31 2014 -0400
Update order on built TicketSQL from simple search in tests
Shifting from "subject" to "default" as aggregator term shifts it to
sorting before "status".
diff --git a/t/ticket/simple_search.t b/t/ticket/simple_search.t
index d9dd354..02bf733 100644
--- a/t/ticket/simple_search.t
+++ b/t/ticket/simple_search.t
@@ -34,8 +34,8 @@ my @tests = (
"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' )");
+ "notauser $queue" => "( Subject LIKE 'notauser' ) AND ( Queue = '$queue' ) AND ( $active_statuses )",
+ "notauser $queue root" => "( Subject LIKE 'notauser' ) AND ( Owner = 'root' ) AND ( Queue = '$queue' ) AND ( $active_statuses )");
while (my ($from, $to) = splice @tests, 0, 2) {
is($quick->QueryToSQL($from), $to, "<$from> -> <$to>");
diff --git a/t/web/simple_search.t b/t/web/simple_search.t
index b323f89..710efb1 100644
--- a/t/web/simple_search.t
+++ b/t/web/simple_search.t
@@ -26,35 +26,36 @@ ok $two_words_queue && $two_words_queue->id, 'loaded or created a queue';
TicketsObj => $tickets,
Argument => '',
);
- is $parser->QueryToSQL("foo"), "$active AND ( Subject LIKE 'foo' )", "correct parsing";
+ is $parser->QueryToSQL("foo"), "( Subject LIKE 'foo' ) AND $active", "correct parsing";
+ is $parser->QueryToSQL("1 foo"), "( Subject LIKE 'foo' AND Subject LIKE '1' ) AND $active", "correct parsing";
is $parser->QueryToSQL("1"), "( Id = 1 )", "correct parsing";
is $parser->QueryToSQL("#1"), "( Id = 1 )", "correct parsing";
- is $parser->QueryToSQL("'1'"), "$active AND ( Subject LIKE '1' )", "correct parsing";
+ is $parser->QueryToSQL("'1'"), "( Subject LIKE '1' ) AND $active", "correct parsing";
is $parser->QueryToSQL("foo bar"),
- "$active AND ( Subject LIKE 'foo' AND Subject LIKE 'bar' )",
+ "( Subject LIKE 'foo' AND Subject LIKE 'bar' ) AND $active",
"correct parsing";
is $parser->QueryToSQL("'foo bar'"),
- "$active AND ( Subject LIKE 'foo bar' )",
+ "( Subject LIKE 'foo bar' ) AND $active",
"correct parsing";
is $parser->QueryToSQL("'foo \\' bar'"),
- "$active AND ( Subject LIKE 'foo \\' bar' )",
+ "( Subject LIKE 'foo \\' bar' ) AND $active",
"correct parsing";
is $parser->QueryToSQL('"foo \' bar"'),
- "$active AND ( Subject LIKE 'foo \\' bar' )",
+ "( Subject LIKE 'foo \\' bar' ) AND $active",
"correct parsing";
is $parser->QueryToSQL('"\f\o\o"'),
- "$active AND ( Subject LIKE '\\\\f\\\\o\\\\o' )",
+ "( Subject LIKE '\\\\f\\\\o\\\\o' ) AND $active",
"correct parsing";
is $parser->QueryToSQL("General"), "( Queue = 'General' ) AND $active", "correct parsing";
- is $parser->QueryToSQL("'Two Words'"), "$active AND ( Subject LIKE 'Two Words' )", "correct parsing";
+ is $parser->QueryToSQL("'Two Words'"), "( Subject LIKE 'Two Words' ) AND $active", "correct parsing";
is $parser->QueryToSQL("queue:'Two Words'"), "( Queue = 'Two Words' ) AND $active", "correct parsing";
is $parser->QueryToSQL("subject:'Two Words'"), "$active AND ( Subject LIKE 'Two Words' )", "correct parsing";
is $parser->QueryToSQL("me"), "( Owner.id = '__CurrentUser__' ) AND $active", "correct parsing";
- is $parser->QueryToSQL("'me'"), "$active AND ( Subject LIKE 'me' )", "correct parsing";
+ is $parser->QueryToSQL("'me'"), "( Subject LIKE 'me' ) AND $active", "correct parsing";
is $parser->QueryToSQL("owner:me"), "( Owner.id = '__CurrentUser__' ) AND $active", "correct parsing";
is $parser->QueryToSQL("owner:'me'"), "( Owner = 'me' ) AND $active", "correct parsing";
is $parser->QueryToSQL('owner:root at localhost'), "( Owner.EmailAddress = 'root\@localhost' ) AND $active", "Email address as owner";
-----------------------------------------------------------------------
More information about the rt-commit
mailing list