X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=rt%2Ft%2Fapi%2Fsearchbuilder.t;h=84568718dd4e323539550ce88260eabca286a195;hb=b8988e1d3ac75af63c85e8563e57701030315a9e;hp=cb118906cfd8cf97f844634e06ad22f734832fd1;hpb=63a268637b2d51a8766412617724b9436439deb6;p=freeside.git diff --git a/rt/t/api/searchbuilder.t b/rt/t/api/searchbuilder.t index cb118906c..84568718d 100644 --- a/rt/t/api/searchbuilder.t +++ b/rt/t/api/searchbuilder.t @@ -2,7 +2,7 @@ use strict; use warnings; use RT; -use RT::Test tests => 11; +use RT::Test tests => 19; { @@ -15,7 +15,7 @@ ok (require RT::SearchBuilder); { use_ok('RT::Queues'); -ok(my $queues = RT::Queues->new($RT::SystemUser), 'Created a queues object'); +ok(my $queues = RT::Queues->new(RT->SystemUser), 'Created a queues object'); ok( $queues->UnLimit(),'Unlimited the result set of the queues object'); my $items = $queues->ItemsArrayRef(); my @items = @{$items}; @@ -37,4 +37,27 @@ is_deeply(\@items_ids, \@sorted_ids, "ItemsArrayRef sorts alphabetically by name } -1; +#20767: CleanSlate doesn't clear RT::SearchBuilder's flags for handling Disabled columns +{ + my $items; + + ok(my $queues = RT::Queues->new(RT->SystemUser), 'Created a queues object'); + ok( $queues->UnLimit(),'Unlimited the result set of the queues object'); + + # sanity check + is( $queues->{'handled_disabled_column'} => undef, 'handled_disabled_column IS NOT set' ); + is( $queues->{'find_disabled_rows'} => undef, 'find_disabled_rows IS NOT set ' ); + + $queues->LimitToDeleted; + + # sanity check + ok( $queues->{'handled_disabled_column'}, 'handled_disabled_column IS set' ); + ok( $queues->{'find_disabled_rows'}, 'find_disabled_rows IS set ' ); + + $queues->CleanSlate; + + # these fail without the overloaded CleanSlate method + is( $queues->{'handled_disabled_column'} => undef, 'handled_disabled_column IS NOT set' ); + is( $queues->{'find_disabled_rows'} => undef, 'find_disabled_rows IS NOT set ' ); +} +