[Rt-commit] rt branch, 3.9-trunk, updated. rt-3.9.7-949-gee636e0
Shawn Moore
sartak at bestpractical.com
Mon Dec 20 12:35:27 EST 2010
The branch, 3.9-trunk has been updated
via ee636e0905852d2f888ed165cfbe0fa358f92bfd (commit)
via 2a08f46c2cb0624238eea9d44830577e28e16775 (commit)
via 55476aba310564e81a042f727177ec4efdda9576 (commit)
via 303660286eaa5fd98be357d037befee5dfedf6c8 (commit)
from 993d50876f5bd04794426b195a415874759f1cee (commit)
Summary of changes:
sbin/rt-email-dashboards.in | 10 ++-
t/web/{dashboards.t => dashboards-basics.t} | 0
..._search.t => dashboards-deleted-saved-search.t} | 0
t/web/dashboards-search-cache.t | 73 ++++++++++++++++++++
4 files changed, 80 insertions(+), 3 deletions(-)
rename t/web/{dashboards.t => dashboards-basics.t} (100%)
rename t/web/{dashboard_with_deleted_saved_search.t => dashboards-deleted-saved-search.t} (100%)
create mode 100644 t/web/dashboards-search-cache.t
- Log -----------------------------------------------------------------
commit 303660286eaa5fd98be357d037befee5dfedf6c8
Author: Shawn M Moore <sartak at bestpractical.com>
Date: Mon Dec 20 11:43:05 2010 -0500
Begin deprecating --epoch in favor of --time
diff --git a/sbin/rt-email-dashboards.in b/sbin/rt-email-dashboards.in
index 3047dc9..9a18de5 100644
--- a/sbin/rt-email-dashboards.in
+++ b/sbin/rt-email-dashboards.in
@@ -78,7 +78,7 @@ BEGIN {
my %opts;
use Getopt::Long;
GetOptions( \%opts,
- "help|h", "dryrun", "epoch=i", "all"
+ "help|h", "dryrun", "time=i", "epoch=i", "all"
);
if ($opts{'help'}) {
@@ -104,7 +104,7 @@ require RT::Dashboard::Mailer;
RT::Dashboard::Mailer->MailDashboards(
All => $opts{all},
DryRun => $opts{dryrun},
- Time => ($opts{epoch} || time),
+ Time => ($opts{time} || $opts{epoch} || time), # epoch is the old-style
Opts => \%opts,
);
@@ -152,12 +152,16 @@ Display this documentation
Figure out which dashboards would be sent, but don't actually generate or email
any of them
-=item --epoch SECONDS
+=item --time SECONDS
Instead of using the current time to figure out which dashboards should be
sent, use SECONDS (usually since midnight Jan 1st, 1970, so C<1192216018> would
be Oct 12 19:06:58 GMT 2007).
+=item --epoch SECONDS
+
+Back-compat for --time SECONDS.
+
=item --all
Ignore subscription frequency when considering each dashboard (should only be
commit 55476aba310564e81a042f727177ec4efdda9576
Author: Shawn M Moore <sartak at bestpractical.com>
Date: Mon Dec 20 12:03:47 2010 -0500
More consistent test name
diff --git a/t/web/dashboard_with_deleted_saved_search.t b/t/web/dashboards-deleted-saved-search.t
similarity index 100%
rename from t/web/dashboard_with_deleted_saved_search.t
rename to t/web/dashboards-deleted-saved-search.t
commit 2a08f46c2cb0624238eea9d44830577e28e16775
Author: Shawn M Moore <sartak at bestpractical.com>
Date: Mon Dec 20 12:26:28 2010 -0500
Make dashboards.t fit the dashboard test name template
diff --git a/t/web/dashboards.t b/t/web/dashboards-basics.t
similarity index 100%
rename from t/web/dashboards.t
rename to t/web/dashboards-basics.t
commit ee636e0905852d2f888ed165cfbe0fa358f92bfd
Author: Shawn M Moore <sartak at bestpractical.com>
Date: Mon Dec 20 12:30:17 2010 -0500
Add todo tests for dashboards caching search names
[issues.bestpractical.com #14225]
diff --git a/t/web/dashboards-search-cache.t b/t/web/dashboards-search-cache.t
new file mode 100644
index 0000000..ad2a969
--- /dev/null
+++ b/t/web/dashboards-search-cache.t
@@ -0,0 +1,73 @@
+#!/usr/bin/perl -w
+use strict;
+
+use RT::Test tests => 20;
+my ($baseurl, $m) = RT::Test->started_ok;
+
+my $url = $m->rt_base_url;
+
+ok($m->login, 'logged in');
+
+# create a search
+$m->follow_link_ok({text => 'Tickets'}, 'to query builder');
+$m->form_name('BuildQuery');
+
+$m->field(ValueOfid => 10 );
+$m->click('AddClause');
+$m->text_contains( 'id < 10', 'added new clause');
+
+$m->form_name('BuildQuery');
+$m->field(SavedSearchDescription => 'Original Name');
+$m->click('SavedSearchSave');
+
+# create a dashboard
+$m->get_ok("$url/Dashboards/Modify.html?Create=1");
+$m->form_name('ModifyDashboard');
+$m->field('Name' => 'cachey dashboard');
+$m->click_button(value => 'Create');
+$m->text_contains('Saved dashboard cachey dashboard');
+
+my ($dashboard_id) = $m->content =~ /name="id" value="(\d+)"/;
+ok($dashboard_id, "got an ID, $dashboard_id");
+
+# add the search to the dashboard
+$m->follow_link_ok({text => 'Content'});
+my $form = $m->form_name('Dashboard-Searches-body');
+my @input = $form->find_input('Searches-body-Available');
+my ($search) =
+ map { ( $_->possible_values )[1] }
+ grep { ( $_->value_names )[1] =~ /Saved Search: Original Name/ } @input;
+$form->value('Searches-body-Available' => $search );
+$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->form_name('SubscribeDashboard');
+$m->click_button(name => 'Save');
+$m->text_contains('Subscribed to dashboard cachey dashboard');
+
+# rename the search
+$m->follow_link_ok({text => 'Tickets'}, 'to query builder');
+$form = $m->form_name('BuildQuery');
+ at input = $form->find_input('SavedSearchLoad');
+($search) =
+ map { ( $_->possible_values )[1] }
+ grep { ( $_->value_names )[1] =~ /Original Name/ } @input;
+$form->value('SavedSearchLoad' => $search );
+$m->click_button(value => 'Load');
+$m->text_contains('Loaded saved search "Original Name"');
+
+$m->form_name('BuildQuery');
+$m->field('SavedSearchDescription' => 'New Name');
+$m->click_button(value => 'Update');
+$m->text_contains('Updated saved search "New Name"');
+
+# 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
+}
-----------------------------------------------------------------------
More information about the Rt-commit
mailing list