diff options
author | Ivan Kohler <ivan@freeside.biz> | 2015-06-12 15:19:00 -0700 |
---|---|---|
committer | Ivan Kohler <ivan@freeside.biz> | 2015-07-09 17:56:53 -0700 |
commit | 31f3763747b82764bb019cfab5b2a2945fc9a99d (patch) | |
tree | 36715bb96a8f9c02eb41f5fdab4a0b181b2d2e3a /rt/t | |
parent | 5e9677cbad2051ea452b389fa03bddf37166c590 (diff) |
rt 4.0.23
Diffstat (limited to 'rt/t')
-rw-r--r-- | rt/t/api/emailparser.t | 8 | ||||
-rw-r--r-- | rt/t/fts/indexed_pg.t | 14 |
2 files changed, 15 insertions, 7 deletions
diff --git a/rt/t/api/emailparser.t b/rt/t/api/emailparser.t index 790314603..a58cb3623 100644 --- a/rt/t/api/emailparser.t +++ b/rt/t/api/emailparser.t @@ -2,12 +2,14 @@ use strict; use warnings; -use RT::Test nodb => 1, tests => 10; +use RT::Test tests => 11; -RT->Config->Set( RTAddressRegexp => qr/^rt\@example.com$/i ); +ok(require RT::EmailParser); +RT->Config->Set( RTAddressRegexp => undef ); +is(RT::EmailParser::IsRTAddress("",""),undef, "Empty emails from users don't match queues without email addresses" ); -ok(require RT::EmailParser); +RT->Config->Set( RTAddressRegexp => qr/^rt\@example.com$/i ); is(RT::EmailParser::IsRTAddress("","rt\@example.com"),1, "Regexp matched rt address" ); is(RT::EmailParser::IsRTAddress("","frt\@example.com"),undef, "Regexp didn't match non-rt address" ); diff --git a/rt/t/fts/indexed_pg.t b/rt/t/fts/indexed_pg.t index b8d4b1bab..88e35ab6a 100644 --- a/rt/t/fts/indexed_pg.t +++ b/rt/t/fts/indexed_pg.t @@ -9,8 +9,6 @@ my ($major, $minor) = $RT::Handle->dbh->get_info(18) =~ /^0*(\d+)\.0*(\d+)/; plan skip_all => "Need Pg 8.2 or higher; we have $major.$minor" if "$major.$minor" < 8.2; -plan tests => 36; - RT->Config->Set( FullTextSearch => Enable => 1, Indexed => 1, Column => 'ContentIndex', Table => 'Attachments' ); setup_indexing(); @@ -70,10 +68,11 @@ sub run_test { diag "Wrong SQL query for '$query':". $tix->BuildSelectQuery if $error; } +my $blase = Encode::decode_utf8("blasé"); @tickets = RT::Test->create_tickets( { Queue => $q->id }, - { Subject => 'fts test 1', Content => 'book' }, - { Subject => 'fts test 2', Content => 'bars' }, + { Subject => 'fts test 1', Content => "book $blase" }, + { Subject => 'fts test 2', Content => "bars blasé", ContentType => 'text/html' }, ); sync_index(); @@ -84,6 +83,11 @@ run_tests( "Content LIKE 'book'" => { $book->id => 1, $bars->id => 0 }, "Content LIKE 'bars'" => { $book->id => 0, $bars->id => 1 }, + # Unicode searching + "Content LIKE '$blase'" => { $book->id => 1, $bars->id => 1 }, + "Content LIKE 'blase'" => { $book->id => 0, $bars->id => 0 }, + "Content LIKE 'blas'" => { $book->id => 0, $bars->id => 0 }, + # make sure that Pg stemming works "Content LIKE 'books'" => { $book->id => 1, $bars->id => 0 }, "Content LIKE 'bar'" => { $book->id => 0, $bars->id => 1 }, @@ -116,3 +120,5 @@ run_tests( ); @tickets = (); + +done_testing; |