[Rt-commit] r12072 - in rt/branches/3.8-TESTING: .

sartak at bestpractical.com sartak at bestpractical.com
Mon May 5 03:20:27 EDT 2008


Author: sartak
Date: Mon May  5 03:20:26 2008
New Revision: 12072

Added:
   rt/branches/3.8-TESTING/t/web/dashboards.t
Modified:
   rt/branches/3.8-TESTING/   (props changed)

Log:
 r54895 at onn:  sartak | 2008-05-05 03:20:07 -0400
 Begin writing tests for dashboards


Added: rt/branches/3.8-TESTING/t/web/dashboards.t
==============================================================================
--- (empty file)
+++ rt/branches/3.8-TESTING/t/web/dashboards.t	Mon May  5 03:20:26 2008
@@ -0,0 +1,37 @@
+#!/usr/bin/perl -w
+use strict;
+
+use Test::More tests => 9;
+use RT::Test;
+my ($baseurl, $m) = RT::Test->started_ok;
+
+my $url = $m->rt_base_url;
+
+my $user_obj = RT::User->new($RT::SystemUser);
+my ($ret, $msg) = $user_obj->LoadOrCreateByEmail('customer at example.com');
+ok($ret, 'ACL test user creation');
+$user_obj->SetName('customer');
+$user_obj->SetPrivileged(1);
+($ret, $msg) = $user_obj->SetPassword('customer');
+$user_obj->PrincipalObj->GrantRight(Right => 'ModifySelf');
+
+ok $m->login(customer => 'customer'), "logged in";
+
+$m->get_ok($url."Prefs/Dashboards/index.html");
+$m->content_lacks("New dashboard", "No 'new dashboard' link because we have no ModifyDashboard");
+
+$m->get_ok($url."Prefs/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");
+
+$user_obj->PrincipalObj->GrantRight(Right => 'ModifyDashboard');
+
+$m->get_ok($url."Prefs/Dashboards/index.html");
+$m->content_contains("New dashboard", "'New dashboard' link because we now have ModifyDashboard");
+
+$m->save_content('test.html');
+
+


More information about the Rt-commit mailing list