[Rt-commit] rt branch, 4.2/dashboard-search-cache, updated. rt-4.0.0rc6-169-gd505133
Shawn Moore
sartak at bestpractical.com
Tue Mar 15 17:05:25 EDT 2011
The branch, 4.2/dashboard-search-cache has been updated
via d505133b3c786d0b7cc5416b5411fd57d51e3b68 (commit)
via 0fab755c9995627bea0867b0f4dbc03dc42bc892 (commit)
from dde30812cc71c5c9fa183304368e9c221aaada57 (commit)
Summary of changes:
share/html/Dashboards/Modify.html | 4 +-
t/web/dashboards-search-cache.t | 42 ++++++++++++++++++++++++++++++++----
2 files changed, 39 insertions(+), 7 deletions(-)
- Log -----------------------------------------------------------------
commit 0fab755c9995627bea0867b0f4dbc03dc42bc892
Author: Shawn M Moore <sartak at bestpractical.com>
Date: Tue Mar 15 17:02:45 2011 -0400
Include the dashboard name in update messages
diff --git a/share/html/Dashboards/Modify.html b/share/html/Dashboards/Modify.html
index 1ff93a8..553248b 100644
--- a/share/html/Dashboards/Modify.html
+++ b/share/html/Dashboards/Modify.html
@@ -137,10 +137,10 @@ if (!$Create && !$tried_create && $id && $ARGS{'Save'}) {
Name => $ARGS{'Name'});
if ($ok) {
- push @results, loc("Dashboard updated");
+ push @results, loc("Dashboard [_1] updated", $Dashboard->Name);
}
else {
- push @results, loc("Dashboard could not be updated: [_1]", $msg);
+ push @results, loc("Dashboard [_1] could not be updated: [_2]", $Dashboard->Name, $msg);
}
}
commit d505133b3c786d0b7cc5416b5411fd57d51e3b68
Author: Shawn M Moore <sartak at bestpractical.com>
Date: Tue Mar 15 17:04:57 2011 -0400
Test that the aggressive caching happens with dashboard names too
diff --git a/t/web/dashboards-search-cache.t b/t/web/dashboards-search-cache.t
index 4baf544..96f7736 100644
--- a/t/web/dashboards-search-cache.t
+++ b/t/web/dashboards-search-cache.t
@@ -1,7 +1,7 @@
#!/usr/bin/perl -w
use strict;
-use RT::Test tests => 23;
+use RT::Test tests => 33;
my ($baseurl, $m) = RT::Test->started_ok;
my $url = $m->rt_base_url;
@@ -20,6 +20,16 @@ $m->form_name('BuildQuery');
$m->field(SavedSearchDescription => 'Original Name');
$m->click('SavedSearchSave');
+# create the inner dashboard
+$m->get_ok("$url/Dashboards/Modify.html?Create=1");
+$m->form_name('ModifyDashboard');
+$m->field('Name' => 'inner dashboard');
+$m->click_button(value => 'Create');
+$m->text_contains('Saved dashboard inner dashboard');
+
+my ($inner_id) = $m->content =~ /name="id" value="(\d+)"/;
+ok($inner_id, "got an ID, $inner_id");
+
# create a dashboard
$m->get_ok("$url/Dashboards/Modify.html?Create=1");
$m->form_name('ModifyDashboard');
@@ -34,16 +44,28 @@ ok($dashboard_id, "got an ID, $dashboard_id");
$m->follow_link_ok({text => 'Content'});
my $form = $m->form_name('Dashboard-Searches-body');
my @input = $form->find_input('Searches-body-Available');
-my ($search) =
+my ($search_value) =
map { ( $_->possible_values )[1] }
grep { ( $_->value_names )[1] =~ /Saved Search: Original Name/ } @input;
-$form->value('Searches-body-Available' => $search );
+$form->value('Searches-body-Available' => $search_value );
+$m->click_button(name => 'add');
+$m->text_contains('Dashboard updated');
+
+# add the dashboard to the dashboard
+$m->follow_link_ok({text => 'Content'});
+$form = $m->form_name('Dashboard-Searches-body');
+ at input = $form->find_input('Searches-body-Available');
+my ($dashboard_value) =
+ map { ( $_->possible_values )[1] }
+ grep { ( $_->value_names )[1] =~ /Dashboard: inner dashboard/ } @input;
+$form->value('Searches-body-Available' => $dashboard_value );
$m->click_button(name => 'add');
$m->text_contains('Dashboard updated');
# subscribe to the dashboard
$m->follow_link_ok({text => 'Subscription'});
$m->text_contains('Saved Search: Original Name');
+$m->text_contains('Dashboard: inner dashboard');
$m->form_name('SubscribeDashboard');
$m->click_button(name => 'Save');
$m->text_contains('Subscribed to dashboard cachey dashboard');
@@ -52,10 +74,10 @@ $m->text_contains('Subscribed to dashboard cachey dashboard');
$m->follow_link_ok({text => 'Tickets'}, 'to query builder');
$form = $m->form_name('BuildQuery');
@input = $form->find_input('SavedSearchLoad');
-($search) =
+($search_value) =
map { ( $_->possible_values )[1] }
grep { ( $_->value_names )[1] =~ /Original Name/ } @input;
-$form->value('SavedSearchLoad' => $search );
+$form->value('SavedSearchLoad' => $search_value );
$m->click_button(value => 'Load');
$m->text_contains('Loaded saved search "Original Name"');
@@ -64,12 +86,22 @@ $m->field('SavedSearchDescription' => 'New Name');
$m->click_button(value => 'Update');
$m->text_contains('Updated saved search "New Name"');
+# rename the dashboard
+$m->get_ok("/Dashboards/Modify.html?id=$inner_id");
+$m->form_name('ModifyDashboard');
+$m->field('Name' => 'recursive dashboard');
+$m->click_button(value => 'Save Changes');
+$m->text_contains('Dashboard recursive dashboard updated');
+
# check subscription page again
$m->get_ok("/Dashboards/Subscription.html?id=$dashboard_id");
TODO: {
local $TODO = 'we cache search names too aggressively';
$m->text_contains('Saved Search: New Name');
$m->text_unlike(qr/Saved Search: Original Name/); # t-w-m lacks text_lacks
+
+ $m->text_contains('Dashboard: recursive dashboard');
+ $m->text_unlike(qr/Dashboard: inner dashboard/); # t-w-m lacks text_lacks
}
$m->get_ok("/Dashboards/Render.html?id=$dashboard_id");
-----------------------------------------------------------------------
More information about the Rt-commit
mailing list