[Rt-commit] r13640 - in rt/3.8/trunk: . share/html/Dashboards t/web

sartak at bestpractical.com sartak at bestpractical.com
Thu Jun 26 20:24:22 EDT 2008


Author: sartak
Date: Thu Jun 26 20:23:59 2008
New Revision: 13640

Modified:
   rt/3.8/trunk/   (props changed)
   rt/3.8/trunk/lib/RT/SharedSetting.pm
   rt/3.8/trunk/share/html/Dashboards/Modify.html
   rt/3.8/trunk/t/web/dashboards.t

Log:
 r63306 at onn:  sartak | 2008-06-26 20:20:32 -0400
 test fixes


Modified: rt/3.8/trunk/lib/RT/SharedSetting.pm
==============================================================================
--- rt/3.8/trunk/lib/RT/SharedSetting.pm	(original)
+++ rt/3.8/trunk/lib/RT/SharedSetting.pm	Thu Jun 26 20:23:59 2008
@@ -372,6 +372,7 @@
     my ($obj_type, $obj_id) = split(/\-/, ($privacy || ''));
 
     unless ($obj_type && $obj_id) {
+        $privacy = '(undef)' if !defined($privacy);
         $RT::Logger->error("Invalid privacy string '$privacy'");
         return undef;
     }

Modified: rt/3.8/trunk/share/html/Dashboards/Modify.html
==============================================================================
--- rt/3.8/trunk/share/html/Dashboards/Modify.html	(original)
+++ rt/3.8/trunk/share/html/Dashboards/Modify.html	Thu Jun 26 20:23:59 2008
@@ -88,6 +88,8 @@
 my $Dashboard = RT::Dashboard->new($session{'CurrentUser'});
 my @privacies = $Dashboard->_PrivacyObjects(Modify => 1);
 
+Abort(loc("Permission denied")) if @privacies == 0;
+
 my $can_delete = $Dashboard->CurrentUserCanDelete;
 
 # user went directly to Modify.html

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	Thu Jun 26 20:23:59 2008
@@ -28,12 +28,14 @@
 $m->content_lacks("New dashboard", "No 'new dashboard' link because we have no ModifyDashboard");
 
 $m->get_ok($url."Dashboards/Modify.html?Create=1");
-$m->form_name('ModifyDashboard');
-$m->field("Name" => 'test dashboard');
-$m->click_button(value => 'Save Changes');
-$m->content_contains("No permission to create dashboards");
+$m->content_contains("Permission denied");
+$m->content_lacks("Save Changes");
 
-$user_obj->PrincipalObj->GrantRight(Right => 'ModifyDashboard');
+$user_obj->PrincipalObj->GrantRight(Right => 'ModifyDashboard', Object => $RT::System);
+
+$m->get_ok($url."Dashboards/Modify.html?Create=1");
+$m->content_lacks("Permission denied");
+$m->content_contains("Save Changes");
 
 $m->get_ok($url."Dashboards/index.html");
 $m->content_contains("New dashboard", "'New dashboard' link because we now have ModifyDashboard");


More information about the Rt-commit mailing list