diff options
Diffstat (limited to 'rt/t/web/query_builder.t')
-rw-r--r-- | rt/t/web/query_builder.t | 33 |
1 files changed, 32 insertions, 1 deletions
diff --git a/rt/t/web/query_builder.t b/rt/t/web/query_builder.t index 0abbfaca8..5a64d4646 100644 --- a/rt/t/web/query_builder.t +++ b/rt/t/web/query_builder.t @@ -5,7 +5,7 @@ use HTTP::Request::Common; use HTTP::Cookies; use LWP; use Encode; -use RT::Test tests => 56; +use RT::Test tests => 70; my $cookie_jar = HTTP::Cookies->new; my ($baseurl, $agent) = RT::Test->started_ok; @@ -295,3 +295,34 @@ diag "click advanced, enter a valid SQL, but the field is lower cased"; ); } +diag "make sure skipped order by field doesn't break search"; +{ + my $t = RT::Test->create_ticket( Queue => 'General', Subject => 'test' ); + ok $t && $t->id, 'created a ticket'; + + $agent->get_ok($url."Search/Edit.html"); + ok($agent->form_name('BuildQueryAdvanced'), "found the form"); + $agent->field("Query", "id = ". $t->id); + $agent->submit; + + $agent->follow_link_ok({id => 'page-results'}); + ok( $agent->find_link( + text => $t->id, + url_regex => qr{/Ticket/Display\.html}, + ), "link to the ticket" ); + + $agent->follow_link_ok({id => 'page-edit_search'}); + $agent->form_name('BuildQuery'); + $agent->field("OrderBy", 'Requestor.EmailAddress', 3); + $agent->submit; + $agent->form_name('BuildQuery'); + is $agent->value('OrderBy', 1), 'id'; + is $agent->value('OrderBy', 2), ''; + is $agent->value('OrderBy', 3), 'Requestor.EmailAddress'; + + $agent->follow_link_ok({id => 'page-results'}); + ok( $agent->find_link( + text => $t->id, + url_regex => qr{/Ticket/Display\.html}, + ), "link to the ticket" ); +} |