X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=rt%2Ft%2Fweb%2Frights1.t;h=2cc7689c66845c69387981cc246329e919b23ce0;hb=de9d037528895f7151a9aead6724ce2df95f9586;hp=24e5c3448d865671de381e32c8a6134f4adec799;hpb=85e677b86fc37c54e6de2b06340351a28f5a5916;p=freeside.git diff --git a/rt/t/web/rights1.t b/rt/t/web/rights1.t index 24e5c3448..2cc7689c6 100644 --- a/rt/t/web/rights1.t +++ b/rt/t/web/rights1.t @@ -1,5 +1,5 @@ -#!/usr/bin/perl -w use strict; +use warnings; use HTTP::Cookies; use RT::Test nodata => 1, tests => 31; @@ -29,9 +29,9 @@ $agent->login( $user_obj->Name, 'customer'); # Test for absence of Configure and Preferences tabs. ok(!$agent->find_link( url => "$RT::WebPath/Admin/", - text => 'Configuration'), "No config tab" ); + text => 'Admin'), "No admin tab" ); ok(!$agent->find_link( url => "$RT::WebPath/User/Prefs.html", - text => 'Preferences'), "No prefs pane" ); + text => 'Preferences'), "No prefs pane" ); # Now test for their presence, one at a time. Sleep for a bit after # ACL changes, thanks to the 10s ACL cache. @@ -43,20 +43,20 @@ $agent->reload; $agent->content_contains('Logout', "Reloaded page successfully"); ok($agent->find_link( url => "$RT::WebPath/Admin/", - text => 'Configuration'), "Found config tab" ); + text => 'Admin'), "Found admin tab" ); my ($revokeid,$revokemsg) =$user_obj->PrincipalObj->RevokeRight(Right => 'ShowConfigTab'); ok ($revokeid,$revokemsg); ($grantid,$grantmsg) =$user_obj->PrincipalObj->GrantRight(Right => 'ModifySelf'); ok ($grantid,$grantmsg); $agent->reload(); $agent->content_contains('Logout', "Reloaded page successfully"); -ok($agent->find_link( - id => 'preferences-settings' ), "Found prefs pane" ); +ok($agent->find_link( + id => 'preferences-settings' ), "Found prefs pane" ); ($revokeid,$revokemsg) = $user_obj->PrincipalObj->RevokeRight(Right => 'ModifySelf'); ok ($revokeid,$revokemsg); # Good. Now load the search page and test Load/Save Search. $agent->follow_link( url => "$RT::WebPath/Search/Build.html", - text => 'Tickets'); + text => 'Tickets'); is($agent->status, 200, "Fetched search builder page"); $agent->content_lacks("Load saved search", "No search loading box"); $agent->content_lacks("Saved searches", "No saved searches box"); @@ -79,23 +79,23 @@ $agent->content_like(qr/input\s+type=['"]submit['"][^>]+name=['"]SavedSearchSave # via SelectOwner. my $queue_obj = RT::Queue->new(RT->SystemUser); -($ret, $msg) = $queue_obj->Create(Name => 'CustomerQueue-'.$$, - Description => 'queue for SelectOwner testing'); +($ret, $msg) = $queue_obj->Create(Name => 'CustomerQueue-'.$$, + Description => 'queue for SelectOwner testing'); ok($ret, "SelectOwner test queue creation. $msg"); my $group_obj = RT::Group->new(RT->SystemUser); ($ret, $msg) = $group_obj->CreateUserDefinedGroup(Name => 'CustomerGroup-'.$$, - Description => 'group for SelectOwner testing'); + Description => 'group for SelectOwner testing'); ok($ret, "SelectOwner test group creation. $msg"); # Add our customer to the customer group, and give it queue rights. ($ret, $msg) = $group_obj->AddMember($user_obj->PrincipalObj->Id()); ok($ret, "Added customer to its group. $msg"); ($grantid,$grantmsg) =$group_obj->PrincipalObj->GrantRight(Right => 'OwnTicket', - Object => $queue_obj); - + Object => $queue_obj); + ok($grantid,$grantmsg); ($grantid,$grantmsg) =$group_obj->PrincipalObj->GrantRight(Right => 'SeeQueue', - Object => $queue_obj); + Object => $queue_obj); ok ($grantid,$grantmsg); # Now. When we look at the search page we should be able to see # ourself in the list of possible owners.