
sartak at bestpractical
May 6, 2008, 3:31 PM
Post #1 of 1
(106 views)
Permalink
|
|
r12119 - in rt/branches/3.8-TESTING: .
|
|
Author: sartak Date: Tue May 6 18:31:39 2008 New Revision: 12119 Modified: rt/branches/3.8-TESTING/ (props changed) rt/branches/3.8-TESTING/t/web/dashboards.t Log: r55144[at]onn: sartak | 2008-05-06 18:30:42 -0400 Finish tests for adding queries Modified: rt/branches/3.8-TESTING/t/web/dashboards.t ============================================================================== --- rt/branches/3.8-TESTING/t/web/dashboards.t (original) +++ rt/branches/3.8-TESTING/t/web/dashboards.t Tue May 6 18:31:39 2008 @@ -1,7 +1,7 @@ #!/usr/bin/perl -w use strict; -use Test::More tests => 24; +use Test::More tests => 32; use RT::Test; my ($baseurl, $m) = RT::Test->started_ok; @@ -57,3 +57,27 @@ $m->field('Searches-Available' => ["2-RT::System"]); $m->click_button(name => 'add'); $m->content_contains("Dashboard updated"); + +my $dashboard = RT::Dashboard->new($currentuser); +my ($id) = $m->content =~ /name="id" value="(\d+)"/; +ok($id, "got an ID, $id"); +$dashboard->LoadById($id); +is($dashboard->Name, "different dashboard"); + +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('DashboardQueries'); +$m->field('Searches-Available' => ["1-RT::System"]); +$m->click_button(name => 'add'); +$m->content_contains("Dashboard updated"); + +RT::Record->FlushCache if RT::Record->can('FlushCache'); +$dashboard = RT::Dashboard->new($currentuser); +$dashboard->LoadById($id); + +@searches = $dashboard->Searches; +is(@searches, 2, "two saved searches in the dashboard"); +like($searches[0]->Name, qr/newest unowned tickets/, "correct existing search name"); +like($searches[1]->Name, qr/highest priority tickets I own/, "correct new search name"); _______________________________________________ Rt-commit mailing list Rt-commit[at]lists.bestpractical.com http://lists.bestpractical.com/cgi-bin/mailman/listinfo/rt-commit
|