diff options
author | sunnavy <sunnavy@bestpractical.com> | 2021-12-01 23:05:53 +0300 |
---|---|---|
committer | sunnavy <sunnavy@bestpractical.com> | 2021-12-02 08:43:37 +0300 |
commit | b6525004b2800e4b8c2dc83445405a1013cb620e (patch) | |
tree | 2a4eb5632748c1bb5a8bc4be60a76130a4143aa4 | |
parent | ba4a8caca7d9f9a229e28194c0ad6a66f2f6d1fa (diff) |
Add tests for shared joins in watcher bundle optimization4.4/ticket-search-reduce-watcher-joins
-rw-r--r-- | t/ticket/search_by_watcher.t | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/t/ticket/search_by_watcher.t b/t/ticket/search_by_watcher.t index 4af5c3401a..6af511e077 100644 --- a/t/ticket/search_by_watcher.t +++ b/t/ticket/search_by_watcher.t @@ -334,6 +334,26 @@ diag 'Test bundle optimization'; [ sort map { $_->Id } $sales_alice_ticket, $engineer_bob_ticket ], 'Found both sales and enginner tickets' ); + + my $requestor_bob_ticket = RT::Test->create_ticket( + Queue => $queue, + Subject => 'Sales bob', + Requestor => 'bob@localhost', + ); + + $tix = RT::Tickets->new( RT->SystemUser ); + $tix->FromSQL( + qq{ + Queue = '$queue' AND + ( Requestor.Name LIKE 'bob' OR CustomRole.{Engineer}.Name LIKE 'bob' ) + } + ); + is( $tix->Count, 2, 'Found correct number of tickets' ); + is_deeply( + [ sort map { $_->Id } @{ $tix->ItemsArrayRef } ], + [ sort map { $_->Id } $requestor_bob_ticket, $engineer_bob_ticket ], + 'Found both bob tickets' + ); } @tickets = (); |