[Rt-commit] rt branch, 4.0/search-now-tabs, updated. rt-4.0.0-174-gc436c69

Shawn Moore sartak at bestpractical.com
Thu May 12 16:53:07 EDT 2011


The branch, 4.0/search-now-tabs has been updated
       via  c436c6968a7b94fe58d197087f02b520f1000a74 (commit)
      from  b3fb92950c30d49c5499cc373fa4dccaa1c3fe4a (commit)

Summary of changes:
 t/web/search_tabs.t |   32 ++++++++++++++++++++++++++++++--
 1 files changed, 30 insertions(+), 2 deletions(-)

- Log -----------------------------------------------------------------
commit c436c6968a7b94fe58d197087f02b520f1000a74
Author: Shawn M Moore <sartak at bestpractical.com>
Date:   Thu May 12 16:52:55 2011 -0400

    Test for search builder dropping SaveChartSearchId

diff --git a/t/web/search_tabs.t b/t/web/search_tabs.t
index 53d8bcb..c7fdfb9 100644
--- a/t/web/search_tabs.t
+++ b/t/web/search_tabs.t
@@ -2,11 +2,11 @@
 use warnings;
 use strict;
 
-use RT::Test tests => 12;
+use RT::Test tests => 25;
 my ($baseurl, $agent) = RT::Test->started_ok;
 
 my $ticket = RT::Ticket->new(RT->SystemUser);
-for ( 1 .. 2 ) {
+for ( 1 .. 3 ) {
     $ticket->Create(
         Subject   => 'Ticket ' . $_,
         Queue     => 'General',
@@ -56,3 +56,31 @@ $agent->follow_link_ok({id => 'page-results'});
 $agent->title_is('Found 2 tickets');
 # }
 
+$agent->follow_link_ok({text => 'Chart'});
+$agent->text_contains('id = 1 OR id = 2');
+$agent->form_name('SaveSearch');
+$agent->field('SavedSearchDescription' => 'this is my saved chart');
+$agent->click_button(name => 'SavedSearchSave');
+
+# Confirm that we saved the chart and that it's the "current chart"
+$agent->text_contains('Chart this is my saved chart saved.');
+$agent->form_name('SaveSearch');
+is($agent->value('SavedSearchDescription'), 'this is my saved chart');
+
+$agent->follow_link_ok({text => 'Edit Search'});
+$agent->form_name('BuildQuery');
+$agent->field('idOp', '=');
+$agent->field('ValueOfid', '3');
+$agent->field('AndOr', 'OR');
+$agent->click_button(name => 'DoSearch');
+
+$agent->title_is('Found 3 tickets');
+
+$agent->follow_link_ok({text => 'Chart'});
+$agent->text_contains('id = 1 OR id = 2 OR id = 3');
+
+# The interesting bit: confirm that the chart we saved is still the
+# "current chart" after roundtripping through search builder
+$agent->form_name('SaveSearch');
+is($agent->value('SavedSearchDescription'), 'this is my saved chart');
+

-----------------------------------------------------------------------


More information about the Rt-commit mailing list