X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=rt%2Ft%2Fticket%2Fsearch.t;h=a43433f06f62d9ed5f9180d972e108d0c5467c9e;hb=681a340f6be4184b1472a8e1fa9cd5d074f6f325;hp=852241fe52dc1acd91cbd51bb7ac0347bb62bff0;hpb=3d0a1bb06b895c5be6e3f0517d355442a6b1e125;p=freeside.git diff --git a/rt/t/ticket/search.t b/rt/t/ticket/search.t index 852241fe5..a43433f06 100644 --- a/rt/t/ticket/search.t +++ b/rt/t/ticket/search.t @@ -283,4 +283,35 @@ like($tix->BuildSelectCountQuery, qr/\bNULL\b/, "Contains upper-case NULL"); unlike($tix->BuildSelectCountQuery, qr/\bnull\b/, "Lacks lower-case NULL"); +# tests for searching by queue lifecycle +$tix = RT::Tickets->new(RT->SystemUser); +$tix->FromSQL('Lifecycle="default"'); +is($tix->Count,7,"We found all 7 tickets in a queue with the default lifecycle"); + +$tix = RT::Tickets->new(RT->SystemUser); +$tix->FromSQL('Lifecycle ="approvals" OR Lifecycle="default"'); +is($tix->Count,7,"We found 7 tickets in a queue with a lifecycle of default or approvals"); + +$tix = RT::Tickets->new(RT->SystemUser); +$tix->FromSQL('Lifecycle ="approvals" AND Lifecycle="default"'); +is($tix->Count,0,"We found 0 tickets in a queue with a lifecycle of default AND approvals...(because that's impossible"); + +$tix = RT::Tickets->new(RT->SystemUser); +$tix->FromSQL('Queue="'.$queue.'" AND Lifecycle="default"'); +is($tix->Count,7,"We found 7 tickets in $queue with a lifecycle of default"); + + +$tix = RT::Tickets->new(RT->SystemUser); +$tix->FromSQL('Lifecycle !="approvals"'); +is($tix->Count,7,"We found 7 tickets in a queue with a lifecycle other than approvals"); + +$tix = RT::Tickets->new(RT->SystemUser); +$tix->FromSQL('Lifecycle!="default"'); +is($tix->Count,0,"We found 0 tickets in a queue with a lifecycle other than default"); + +$tix = RT::Tickets->new(RT->SystemUser); +$tix->FromSQL('Lifecycle="approvals"'); +is($tix->Count,0,"We found 0 tickets in a queue with the approvals lifecycle"); + + done_testing;