[Rt-commit] r14163 - in rt/branches/3.999-DANGEROUS: t/web

sunnavy at bestpractical.com sunnavy at bestpractical.com
Wed Jul 16 10:02:53 EDT 2008


Author: sunnavy
Date: Wed Jul 16 10:02:24 2008
New Revision: 14163

Modified:
   rt/branches/3.999-DANGEROUS/   (props changed)
   rt/branches/3.999-DANGEROUS/t/web/rights1.t

Log:
 r14560 at sunnavys-mb:  sunnavy | 2008-07-16 21:51:38 +0800
 


Modified: rt/branches/3.999-DANGEROUS/t/web/rights1.t
==============================================================================
--- rt/branches/3.999-DANGEROUS/t/web/rights1.t	(original)
+++ rt/branches/3.999-DANGEROUS/t/web/rights1.t	Wed Jul 16 10:02:24 2008
@@ -8,13 +8,13 @@
 
 # Create a user with basically no rights, to start.
 my $user_obj = RT::Model::User->new(current_user => RT->system_user);
-my ($ret, $msg) = $user_object->load_or_create_by_email('customer-'.$$.'@example.com');
+my ($ret, $msg) = $user_obj->load_or_create_by_email('customer-'.$$.'@example.com');
 ok($ret, 'ACL test user creation');
-($ret,$msg) =$user_object->set_name('customer-'.$$);
+($ret,$msg) =$user_obj->set_name('customer-'.$$);
 ok($ret,$msg);
-($ret,$msg) = $user_object->set_privileged(1);
+($ret,$msg) = $user_obj->set_privileged(1);
 ok($ret,$msg);
-($ret, $msg) = $user_object->set_password('customer');
+($ret, $msg) = $user_obj->set_password('customer');
 ok($ret, "ACL test password set. $msg");
 
 # Now test the web interface, making sure objects come and go as
@@ -29,7 +29,7 @@
 
 no warnings 'once';
 # get the top page
-$agent->login($user_object->name => 'customer');
+$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" );
@@ -38,7 +38,7 @@
 
 # Now test for their presence, one at a time.  Sleep for a bit after
 # ACL changes, thanks to the 10s ACL cache.
-my ($grantid,$grantmsg) =$user_object->principal_object->grant_right(right => 'ShowConfigTab', object => RT->system);
+my ($grantid,$grantmsg) =$user_obj->principal_object->grant_right(right => 'ShowConfigTab', object => RT->system);
 
 ok($grantid,$grantmsg);
 
@@ -47,15 +47,15 @@
 like($agent->{'content'} , qr/Logout/i, "Reloaded page successfully");
 ok($agent->find_link( url => "$RT::WebPath/Admin/",
 		       text => 'Configuration'), "Found config tab" );
-my ($revokeid,$revokemsg) =$user_object->principal_object->revoke_right(right => 'ShowConfigTab');
+my ($revokeid,$revokemsg) =$user_obj->principal_object->revoke_right(right => 'ShowConfigTab');
 ok ($revokeid,$revokemsg);
-($grantid,$grantmsg) =$user_object->principal_object->grant_right(right => 'ModifySelf');
+($grantid,$grantmsg) =$user_obj->principal_object->grant_right(right => 'ModifySelf');
 ok ($grantid,$grantmsg);
 $agent->reload();
 like($agent->{'content'} , qr/Logout/i, "Reloaded page successfully");
 ok($agent->find_link( 
 		       text => 'Preferences'), "Found prefs pane" );
-($revokeid,$revokemsg) = $user_object->principal_object->revoke_right(right => 'ModifySelf');
+($revokeid,$revokemsg) = $user_obj->principal_object->revoke_right(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",
@@ -64,14 +64,14 @@
 ok($agent->{'content'} !~ /Load saved search/i, "No search loading box");
 ok($agent->{'content'} !~ /Saved searches/i, "No saved searches box");
 
-($grantid,$grantmsg) = $user_object->principal_object->grant_right(right => 'LoadSavedSearch');
+($grantid,$grantmsg) = $user_obj->principal_object->grant_right(right => 'LoadSavedSearch');
 ok($grantid,$grantmsg);
 $agent->reload();
 like($agent->{'content'} , qr/Load saved search/i, "Search loading box exists");
 ok($agent->{'content'} !~ /input\s+type=['"]submit['"][^>]+name=['"]SavedSearchSave['"]/i, 
    "Still no saved searches box");
 
-($grantid,$grantmsg) =$user_object->principal_object->grant_right(right => 'CreateSavedSearch');
+($grantid,$grantmsg) =$user_obj->principal_object->grant_right(right => 'CreateSavedSearch');
 ok ($grantid,$grantmsg);
 $agent->reload();
 like($agent->{'content'} , qr/Load saved search/i, 
@@ -92,7 +92,7 @@
 ok($ret, "SelectOwner test group creation. $msg");
 
 # Add our customer to the customer group, and give it queue rights.
-($ret, $msg) = $group_obj->add_member($user_object->principal_object->id());
+($ret, $msg) = $group_obj->add_member($user_obj->principal_object->id());
 ok($ret, "Added customer to its group. $msg");
 ($grantid,$grantmsg) =$group_obj->principal_object->grant_right(right => 'OwnTicket',
 				     object => $queue_obj);
@@ -109,5 +109,4 @@
 my $input = $agent->current_form->find_input('value_of_actor');
 ok(grep(/customer-$$/, $input->value_names()), "Found self in the actor listing");
 
-die join(',',$input->value_names);
 1;


More information about the Rt-commit mailing list