[Rt-commit] rt branch, 3.9-fix-queue-caching, updated. rt-3.8.8-796-g7969beb

? sunnavy sunnavy at bestpractical.com
Thu Sep 23 21:47:32 EDT 2010


The branch, 3.9-fix-queue-caching has been updated
       via  7969beb2db35e5b7c51d7f3a8f595f099c29cede (commit)
      from  ee1a4207cc6aed5d3a76a7a3c8315b88406e3bd8 (commit)

Summary of changes:
 t/web/dashboards.t |   23 ++++++++++++++++++-----
 1 files changed, 18 insertions(+), 5 deletions(-)

- Log -----------------------------------------------------------------
commit 7969beb2db35e5b7c51d7f3a8f595f099c29cede
Author: sunnavy <sunnavy at bestpractical.com>
Date:   Fri Sep 24 09:45:10 2010 +0800

    use name to find the value instead of using attribute id directly, which is very fragile

diff --git a/t/web/dashboards.t b/t/web/dashboards.t
index 303d10f..a018400 100644
--- a/t/web/dashboards.t
+++ b/t/web/dashboards.t
@@ -92,8 +92,12 @@ $m->content_contains("Modify the dashboard different dashboard");
 
 $m->follow_link_ok({text => "Queries"});
 $m->content_contains("Modify the queries of dashboard different dashboard");
-$m->form_name('Dashboard-Searches-body');
-$m->field('Searches-body-Available' => ["search-3-RT::System-1"]);
+my $form = $m->form_name('Dashboard-Searches-body');
+my @input = $form->find_input('Searches-body-Available');
+my ($unowned) =
+  map { ( $_->possible_values )[1] }
+  grep { ( $_->value_names )[1] =~ 'Saved Search: Unowned Tickets' } @input;
+$form->value('Searches-body-Available' => $unowned );
 $m->click_button(name => 'add');
 $m->content_contains("Dashboard updated");
 
@@ -110,7 +114,12 @@ my @searches = $dashboard->Searches;
 is(@searches, 1, "one saved search in the dashboard");
 like($searches[0]->Name, qr/newest unowned tickets/, "correct search name");
 
-$m->form_name('Dashboard-Searches-body');
+$form = $m->form_name('Dashboard-Searches-body');
+ at input = $form->find_input('Searches-body-Available');
+my ($my_tickets) =
+  map { ( $_->possible_values )[1] }
+  grep { ( $_->value_names )[1] =~ 'Saved Search: My Tickets' } @input;
+$form->value('Searches-body-Available' => $my_tickets );
 $m->field('Searches-body-Available' => ["search-2-RT::System-1"]);
 $m->click_button(name => 'add');
 $m->content_contains("Dashboard updated");
@@ -224,8 +233,12 @@ $m->content_contains("Saved dashboard system dashboard");
 
 $m->follow_link_ok({text => 'Queries'});
 
-$m->form_name('Dashboard-Searches-body');
-$m->field('Searches-body-Available' => ['search-8-RT::User-22']); # XXX: :( :(
+$form = $m->form_name('Dashboard-Searches-body');
+ at input = $form->find_input('Searches-body-Available');
+my ($personal) =
+  map { ( $_->possible_values )[1] }
+  grep { ( $_->value_names )[1] =~ 'Saved Search: personal search' } @input;
+$form->value('Searches-body-Available' => $personal );
 $m->click_button(name => 'add');
 $m->content_contains("Dashboard updated");
 

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


More information about the Rt-commit mailing list