X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=rt%2Ft%2Fapi%2Fsearchbuilder.t;h=9237dcd375f328b7869222a0110fbe5fceaa53e0;hb=31399723786cf0510e15b88ff7b8eaec3c909def;hp=8562bfc2b1ac62036bf0d9303ea12f8d939050d0;hpb=f3c4966ed1f6ec3db7accd6dcdd3a5a3821d72a7;p=freeside.git diff --git a/rt/t/api/searchbuilder.t b/rt/t/api/searchbuilder.t index 8562bfc2b..9237dcd37 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; { @@ -20,7 +20,7 @@ ok( $queues->UnLimit(),'Unlimited the result set of the queues object'); my $items = $queues->ItemsArrayRef(); my @items = @{$items}; -ok($queues->NewItem->_Accessible('Name','read')); +ok($queues->RecordClass->_Accessible('Name','read')); my @sorted = sort {lc($a->Name) cmp lc($b->Name)} @items; ok (@sorted, "We have an array of queues, sorted". join(',',map {$_->Name} @sorted)); @@ -37,3 +37,27 @@ is_deeply(\@items_ids, \@sorted_ids, "ItemsArrayRef sorts alphabetically by name } +#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 ' ); +} +