[Rt-commit] r13567 - in rt/3.8/trunk: t/web
sartak at bestpractical.com
sartak at bestpractical.com
Tue Jun 24 15:45:34 EDT 2008
Author: sartak
Date: Tue Jun 24 15:45:21 2008
New Revision: 13567
Modified:
rt/3.8/trunk/ (props changed)
rt/3.8/trunk/t/web/dashboards.t
Log:
r63168 at onn: sartak | 2008-06-24 15:44:03 -0400
Basic tests for deleting dashboards
Modified: rt/3.8/trunk/t/web/dashboards.t
==============================================================================
--- rt/3.8/trunk/t/web/dashboards.t (original)
+++ rt/3.8/trunk/t/web/dashboards.t Tue Jun 24 15:45:21 2008
@@ -1,7 +1,7 @@
#!/usr/bin/perl -w
use strict;
-use Test::More tests => 59;
+use Test::More tests => 66;
use RT::Test;
my ($baseurl, $m) = RT::Test->started_ok;
@@ -41,6 +41,7 @@
$m->follow_link_ok({text => "New dashboard"});
$m->form_name('ModifyDashboard');
$m->field("Name" => 'different dashboard');
+$m->content_lacks('Delete', "Delete button hidden because we lack DeleteDashboard");
$m->click_button(value => 'Save Changes');
$m->content_lacks("No permission to create dashboards");
$m->content_contains("Saved dashboard different dashboard");
@@ -147,3 +148,18 @@
RT::Record->FlushCache if RT::Record->can('FlushCache');
is($user_obj->Attributes->Named('Subscription'), 0, "no more subscriptions");
+
+$m->get_ok("/Dashboards/Modify.html?id=$id&Delete=1");
+$m->content_contains("Permission denied", "unable to delete dashboard because we lack DeleteDashboard");
+
+$user_obj->PrincipalObj->GrantRight(Right => 'DeleteDashboard');
+$m->get_ok("/Dashboards/Modify.html?id=$id");
+$m->content_contains('Delete', "Delete button shows because we have DeleteDashboard");
+
+$m->form_name('ModifyDashboard');
+$m->click_button(name => 'Delete');
+$m->content_contains("Deleted dashboard $id");
+
+$m->get("/Dashboards/Modify.html?id=$id");
+$m->content_contains("Could not load dashboard");
+
More information about the Rt-commit
mailing list