[Rt-commit] rt branch, 4.0/skip-empty-orderby-items, updated. rt-4.0.4-140-g42d90ee
Kevin Falcone
falcone at bestpractical.com
Fri Feb 3 19:41:35 EST 2012
The branch, 4.0/skip-empty-orderby-items has been updated
via 42d90eea1927e203943b303942c501849463b4f7 (commit)
via d171dc1e4f7de7362f0fed04262571dbff8da21a (commit)
from 328ca2ff1a79fad7601e3245ec37518381e0081d (commit)
Summary of changes:
t/web/query_builder.t | 33 ++++++++++++++++++++++++++++++++-
t/web/search_order_by.t | 29 -----------------------------
2 files changed, 32 insertions(+), 30 deletions(-)
delete mode 100644 t/web/search_order_by.t
- Log -----------------------------------------------------------------
commit d171dc1e4f7de7362f0fed04262571dbff8da21a
Author: Kevin Falcone <falcone at bestpractical.com>
Date: Fri Feb 3 19:40:07 2012 -0500
Remove a non-failing test
The test from 328ca2ff1a79fad7601e3245ec37518381e0081d didn't fail, so
we'll bring in one that does.
diff --git a/t/web/search_order_by.t b/t/web/search_order_by.t
deleted file mode 100644
index 09ecf55..0000000
--- a/t/web/search_order_by.t
+++ /dev/null
@@ -1,29 +0,0 @@
-#!/usr/bin/env perl
-use strict;
-use warnings;
-use RT::Test tests => undef;
-
-# TODO generalize this into a series of (currently
-# unwritten) Advanced Search tests
-
-
-my $ticket = RT::Test->create_ticket(
- Subject => 'test ticket',
- Queue => 'General',
-);
-
-my ( $baseurl, $m ) = RT::Test->started_ok;
-ok $m->login, 'logged in as root';
-
-# Create a ticket with content and an attachment
-$m->get_ok( $baseurl . '/Search/Build.html' );
-
-$m->form_name('BuildQuery');
-$m->field(OrderBy => 'id||Due');
-$m->field(Query => 'id > 0');
-$m->click_button(name => 'DoSearch');
-
-$m->text_contains('Found 1 ticket');
-
-undef $m;
-done_testing();
commit 42d90eea1927e203943b303942c501849463b4f7
Author: Ruslan Zakirov <ruz at bestpractical.com>
Date: Fri Feb 3 01:43:33 2012 +0400
failing test for fix in 4.0/skip-empty-orderby-items branch
diff --git a/t/web/query_builder.t b/t/web/query_builder.t
index 0abbfac..5a64d46 100644
--- a/t/web/query_builder.t
+++ b/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" );
+}
-----------------------------------------------------------------------
More information about the Rt-commit
mailing list