[Rt-commit] r15377 - in rt/branches/3.999-DANGEROUS: . t/api t/maildigest t/web
jesse at bestpractical.com
jesse at bestpractical.com
Fri Aug 22 14:43:13 EDT 2008
Author: jesse
Date: Fri Aug 22 14:43:12 2008
New Revision: 15377
Modified:
rt/branches/3.999-DANGEROUS/ (props changed)
rt/branches/3.999-DANGEROUS/t/api/reminders.t
rt/branches/3.999-DANGEROUS/t/maildigest/attributes.t
rt/branches/3.999-DANGEROUS/t/ticket/action_linear_escalate.t
rt/branches/3.999-DANGEROUS/t/ticket/add-watchers.t
rt/branches/3.999-DANGEROUS/t/ticket/cfsort-freeform-multiple.t
rt/branches/3.999-DANGEROUS/t/ticket/cfsort-freeform-single.t
rt/branches/3.999-DANGEROUS/t/ticket/deferred_owner.t
rt/branches/3.999-DANGEROUS/t/ticket/search_long_cf_values.t
rt/branches/3.999-DANGEROUS/t/ticket/sort-by-queue.t
rt/branches/3.999-DANGEROUS/t/ticket/sort-by-user.t
rt/branches/3.999-DANGEROUS/t/web/cf_onqueue.t
rt/branches/3.999-DANGEROUS/t/web/dashboards-groups.t
rt/branches/3.999-DANGEROUS/t/web/dashboards.t
Log:
r44030 at 68-246-31-102: jesse | 2008-08-22 14:23:39 -0400
* A bunch more test fscking
Modified: rt/branches/3.999-DANGEROUS/t/api/reminders.t
==============================================================================
--- rt/branches/3.999-DANGEROUS/t/api/reminders.t (original)
+++ rt/branches/3.999-DANGEROUS/t/api/reminders.t Fri Aug 22 14:43:12 2008
@@ -10,9 +10,9 @@
{
# Create test queues
-use_ok ('RT::Queue');
+use_ok ('RT::Model::Queue');
-ok(my $testqueue = RT::Queue->new($RT::SystemUser), 'Instantiate RT::Queue');
+ok(my $testqueue = RT::Model::Queue->new(current_user => RT->system_user), 'Instantiate RT::Model::Queue');
ok($testqueue->create( Name => 'reminders tests'), 'Create new queue: reminders tests');
isnt($testqueue->Id , 0, 'Success creating queue');
Modified: rt/branches/3.999-DANGEROUS/t/maildigest/attributes.t
==============================================================================
--- rt/branches/3.999-DANGEROUS/t/maildigest/attributes.t (original)
+++ rt/branches/3.999-DANGEROUS/t/maildigest/attributes.t Fri Aug 22 14:43:12 2008
@@ -38,7 +38,7 @@
is(RT::Config->Get('EmailFrequency' => $user_s), 'Suspended');
# Make a testing queue for ourselves.
-my $testq = RT::Queue->new( $RT::SystemUser );
+my $testq = RT::Model::Queue->new(current_user => RT->system_user );
if( $testq->ValidateName( 'EmailDigest-testqueue' ) ) {
( $ret, $msg ) = $testq->create( Name => 'EmailDigest-testqueue' );
ok( $ret, "Our test queue is created: $msg" );
@@ -48,30 +48,30 @@
}
# Allow anyone to open a ticket on the test queue.
-my $everyone = RT::Group->new( $RT::SystemUser );
+my $everyone = RT::Model::Group->new(current_user => RT->system_user );
( $ret, $msg ) = $everyone->LoadSystemInternalGroup( 'Everyone' );
ok( $ret, "Loaded 'everyone' group: $msg" );
-( $ret, $msg ) = $everyone->PrincipalObj->GrantRight( Right => 'CreateTicket',
+( $ret, $msg ) = $everyone->principal_object->grant_right( Right => 'CreateTicket',
Object => $testq );
ok( $ret || $msg =~ /already has/, "Granted everyone CreateTicket on testq: $msg" );
# Make user_d an admincc for the queue.
-( $ret, $msg ) = $user_d->PrincipalObj->GrantRight( Right => 'AdminQueue',
+( $ret, $msg ) = $user_d->principal_object->grant_right( Right => 'AdminQueue',
Object => $testq );
ok( $ret || $msg =~ /already has/, "Granted dduser AdminQueue on testq: $msg" );
( $ret, $msg ) = $testq->AddWatcher( Type => 'AdminCc',
- PrincipalId => $user_d->PrincipalObj->id );
+ PrincipalId => $user_d->principal_object->id );
ok( $ret || $msg =~ /already/, "dduser added as a queue watcher: $msg" );
# Give the others queue rights.
-( $ret, $msg ) = $user_n->PrincipalObj->GrantRight( Right => 'AdminQueue',
+( $ret, $msg ) = $user_n->principal_object->grant_right( Right => 'AdminQueue',
Object => $testq );
ok( $ret || $msg =~ /already has/, "Granted emailnormal right on testq: $msg" );
-( $ret, $msg ) = $user_w->PrincipalObj->GrantRight( Right => 'AdminQueue',
+( $ret, $msg ) = $user_w->principal_object->grant_right( Right => 'AdminQueue',
Object => $testq );
ok( $ret || $msg =~ /already has/, "Granted emailweekly right on testq: $msg" );
-( $ret, $msg ) = $user_s->PrincipalObj->GrantRight( Right => 'AdminQueue',
+( $ret, $msg ) = $user_s->principal_object->grant_right( Right => 'AdminQueue',
Object => $testq );
ok( $ret || $msg =~ /already has/, "Granted emailsusp right on testq: $msg" );
@@ -86,10 +86,10 @@
# Make the other users ticket watchers.
( $ret, $msg ) = $ticket->AddWatcher( Type => 'Cc',
- PrincipalId => $user_n->PrincipalObj->id );
+ PrincipalId => $user_n->principal_object->id );
ok( $ret, "Added user_w as a ticket watcher: $msg" );
( $ret, $msg ) = $ticket->AddWatcher( Type => 'Cc',
- PrincipalId => $user_s->PrincipalObj->id );
+ PrincipalId => $user_s->principal_object->id );
ok( $ret, "Added user_s as a ticket watcher: $msg" );
my $obj;
Modified: rt/branches/3.999-DANGEROUS/t/ticket/action_linear_escalate.t
==============================================================================
--- rt/branches/3.999-DANGEROUS/t/ticket/action_linear_escalate.t (original)
+++ rt/branches/3.999-DANGEROUS/t/ticket/action_linear_escalate.t Fri Aug 22 14:43:12 2008
@@ -26,7 +26,7 @@
ok $gecos && $gecos->id, 'loaded or created gecos user';
# get rid of all right permissions
-$gecos->PrincipalObj->GrantRight( Right => 'SuperUser' );
+$gecos->principal_object->grant_right( Right => 'SuperUser' );
my $user = RT::Test->load_or_create_user(
@@ -34,7 +34,7 @@
);
ok $user && $user->id, 'loaded or created user';
-$user->PrincipalObj->GrantRight( Right => 'SuperUser' );
+$user->principal_object->grant_right( Right => 'SuperUser' );
my $current_user = RT::CurrentUser->new($RT::SystemUser);
($id, $msg) = $current_user->Load($user->id);
ok( $id, "Got current user? $msg" );
Modified: rt/branches/3.999-DANGEROUS/t/ticket/add-watchers.t
==============================================================================
--- rt/branches/3.999-DANGEROUS/t/ticket/add-watchers.t (original)
+++ rt/branches/3.999-DANGEROUS/t/ticket/add-watchers.t Fri Aug 22 14:43:12 2008
@@ -52,7 +52,7 @@
use warnings;
no warnings 'once';
-use RT::Queue;
+use RT::Model::Queue;
use RT::Model::User;
use RT::Group;
use RT::Model::Ticket;
@@ -68,24 +68,24 @@
}
# create new queue to be sure we do not mess with rights
-my $queue = RT::Queue->new($RT::SystemUser);
+my $queue = RT::Model::Queue->new(current_user => RT->system_user);
my ($queue_id) = $queue->create( Name => 'watcher tests '.$$);
ok( $queue_id, 'queue created for watcher tests' );
# new privileged user to check rights
my $user = RT::Model::User->new(current_user => RT->system_user );
my ($user_id) = $user->create( Name => 'watcher'.$$,
- EmailAddress => "watcher$$".'@localhost',
+ email => "watcher$$".'@localhost',
Privileged => 1,
Password => 'qwe123',
);
my $cu= RT::CurrentUser->new($user);
# make sure user can see tickets in the queue
-my $principal = $user->PrincipalObj;
+my $principal = $user->principal_object;
ok( $principal, "principal loaded" );
-$principal->GrantRight( Right => 'ShowTicket', Object => $queue );
-$principal->GrantRight( Right => 'SeeQueue' , Object => $queue );
+$principal->grant_right( Right => 'ShowTicket', Object => $queue );
+$principal->grant_right( Right => 'SeeQueue' , Object => $queue );
ok( $user->HasRight( Right => 'SeeQueue', Object => $queue ), "user can see queue" );
ok( $user->HasRight( Right => 'ShowTicket', Object => $queue ), "user can show queue tickets" );
@@ -105,7 +105,7 @@
ok( !$rv, "user can't add self as Cc" );
($rv, $msg) = $ticket2->AddWatcher( Type => 'Requestor', PrincipalId => $user->PrincipalId );
ok( !$rv, "user can't add self as Requestor" );
-$principal->GrantRight( Right => 'Watch' , Object => $queue );
+$principal->grant_right( Right => 'Watch' , Object => $queue );
ok( $user->HasRight( Right => 'Watch', Object => $queue ), "user can watch queue tickets" );
($rv, $msg) = $ticket2->AddWatcher( Type => 'Cc', PrincipalId => $user->PrincipalId );
ok( $rv, "user can add self as Cc by PrincipalId" );
@@ -115,19 +115,19 @@
# remove user and try adding with Email address
($rv, $msg) = $ticket->DeleteWatcher( Type => 'Cc', PrincipalId => $user->PrincipalId );
ok( $rv, "watcher removed by PrincipalId" );
-($rv, $msg) = $ticket->DeleteWatcher( Type => 'Requestor', Email => $user->EmailAddress );
+($rv, $msg) = $ticket->DeleteWatcher( Type => 'Requestor', Email => $user->email );
ok( $rv, "watcher removed by Email" );
-($rv, $msg) = $ticket2->AddWatcher( Type => 'Cc', Email => $user->EmailAddress );
+($rv, $msg) = $ticket2->AddWatcher( Type => 'Cc', Email => $user->email );
ok( $rv, "user can add self as Cc by Email" );
-($rv, $msg) = $ticket2->AddWatcher( Type => 'Requestor', Email => $user->EmailAddress );
+($rv, $msg) = $ticket2->AddWatcher( Type => 'Requestor', Email => $user->email );
ok( $rv, "user can add self as Requestor by Email" );
# Queue watcher tests
-$principal->RevokeRight( Right => 'Watch' , Object => $queue );
+$principal->revoke_right( Right => 'Watch' , Object => $queue );
ok( !$user->HasRight( Right => 'Watch', Object => $queue ), "user queue watch right revoked" );
-my $queue2 = RT::Queue->new( $cu );
+my $queue2 = RT::Model::Queue->new( $cu );
($rv, $msg) = $queue2->Load( $queue->id );
ok( $rv, "user loaded queue" );
@@ -136,7 +136,7 @@
ok( !$rv, "user can't add self as Cc" );
($rv, $msg) = $queue2->AddWatcher( Type => 'Requestor', PrincipalId => $user->PrincipalId );
ok( !$rv, "user can't add self as Requestor" );
-$principal->GrantRight( Right => 'Watch' , Object => $queue );
+$principal->grant_right( Right => 'Watch' , Object => $queue );
ok( $user->HasRight( Right => 'Watch', Object => $queue ), "user can watch queue queues" );
($rv, $msg) = $queue2->AddWatcher( Type => 'Cc', PrincipalId => $user->PrincipalId );
ok( $rv, "user can add self as Cc by PrincipalId" );
@@ -146,12 +146,12 @@
# remove user and try adding with Email address
($rv, $msg) = $queue->DeleteWatcher( Type => 'Cc', PrincipalId => $user->PrincipalId );
ok( $rv, "watcher removed by PrincipalId" );
-($rv, $msg) = $queue->DeleteWatcher( Type => 'Requestor', Email => $user->EmailAddress );
+($rv, $msg) = $queue->DeleteWatcher( Type => 'Requestor', Email => $user->email );
ok( $rv, "watcher removed by Email" );
-($rv, $msg) = $queue2->AddWatcher( Type => 'Cc', Email => $user->EmailAddress );
+($rv, $msg) = $queue2->AddWatcher( Type => 'Cc', Email => $user->email );
ok( $rv, "user can add self as Cc by Email" );
-($rv, $msg) = $queue2->AddWatcher( Type => 'Requestor', Email => $user->EmailAddress );
+($rv, $msg) = $queue2->AddWatcher( Type => 'Requestor', Email => $user->email );
ok( $rv, "user can add self as Requestor by Email" );
Modified: rt/branches/3.999-DANGEROUS/t/ticket/cfsort-freeform-multiple.t
==============================================================================
--- rt/branches/3.999-DANGEROUS/t/ticket/cfsort-freeform-multiple.t (original)
+++ rt/branches/3.999-DANGEROUS/t/ticket/cfsort-freeform-multiple.t Fri Aug 22 14:43:12 2008
@@ -7,7 +7,7 @@
use warnings;
use RT::Model::TicketCollection;
-use RT::Queue;
+use RT::Model::Queue;
use RT::CustomField;
# Test Sorting by custom fields.
@@ -16,7 +16,7 @@
my $queue_name = "CFSortQueue-$$";
my $queue;
{
- $queue = RT::Queue->new( $RT::SystemUser );
+ $queue = RT::Model::Queue->new(current_user => RT->system_user );
my ($ret, $msg) = $queue->create(
Name => $queue_name,
Description => 'queue for custom field sort testing'
Modified: rt/branches/3.999-DANGEROUS/t/ticket/cfsort-freeform-single.t
==============================================================================
--- rt/branches/3.999-DANGEROUS/t/ticket/cfsort-freeform-single.t (original)
+++ rt/branches/3.999-DANGEROUS/t/ticket/cfsort-freeform-single.t Fri Aug 22 14:43:12 2008
@@ -7,7 +7,7 @@
use warnings;
use RT::Model::TicketCollection;
-use RT::Queue;
+use RT::Model::Queue;
use RT::CustomField;
# Test Sorting by FreeformSingle custom field.
@@ -16,7 +16,7 @@
my $queue_name = "CFSortQueue-$$";
my $queue;
{
- $queue = RT::Queue->new( $RT::SystemUser );
+ $queue = RT::Model::Queue->new(current_user => RT->system_user );
my ($ret, $msg) = $queue->create(
Name => $queue_name,
Description => 'queue for custom field sort testing'
Modified: rt/branches/3.999-DANGEROUS/t/ticket/deferred_owner.t
==============================================================================
--- rt/branches/3.999-DANGEROUS/t/ticket/deferred_owner.t (original)
+++ rt/branches/3.999-DANGEROUS/t/ticket/deferred_owner.t Fri Aug 22 14:43:12 2008
@@ -9,106 +9,106 @@
my $tester = RT::Test->load_or_create_user(
- EmailAddress => 'tester at localhost',
+ email => 'tester at localhost',
);
ok $tester && $tester->id, 'loaded or created user';
-my $queue = RT::Test->load_or_create_queue( Name => 'General' );
+my $queue = RT::Test->load_or_create_queue( name => 'General' );
ok $queue && $queue->id, 'loaded or created queue';
-my $owner_role_group = RT::Group->new( $RT::SystemUser );
-$owner_role_group->LoadQueueRoleGroup( Type => 'Owner', Queue => $queue->id );
+my $owner_role_group = RT::Model::Group->new(current_user => RT->system_user );
+$owner_role_group->load_queue_role_group( type => 'owner', queue => $queue->id );
ok $owner_role_group->id, 'loaded owners role group of the queue';
diag "check that deffering owner doesn't regress" if $ENV{'TEST_VERBOSE'};
{
RT::Test->set_rights(
- { Principal => $tester->PrincipalObj,
- Right => [qw(SeeQueue ShowTicket CreateTicket OwnTicket)],
+ { principal => $tester->principal_object,
+ right => [qw(Seequeue ShowTicket CreateTicket OwnTicket)],
},
- { Principal => $owner_role_group->PrincipalObj,
- Object => $queue,
- Right => [qw(ModifyTicket)],
+ { principal => $owner_role_group->principal_object,
+ object => $queue,
+ right => [qw(ModifyTicket)],
},
);
my $ticket = RT::Model::Ticket->new(current_user => $tester );
# tester is owner, owner has right to modify owned tickets,
- # this right is required to set somebody as AdminCc
+ # this right is required to set somebody as Admincc
my ($tid, $txn_id, $msg) = $ticket->create(
- Queue => $queue->id,
- Owner => $tester->id,
- AdminCc => 'root at localhost',
+ queue => $queue->id,
+ owner => $tester->id,
+ admin_cc => 'root at localhost',
);
diag $msg if $msg && $ENV{'TEST_VERBOSE'};
ok $tid, "created a ticket";
- is $ticket->Owner, $tester->id, 'correct owner';
- like $ticket->AdminCcAddresses, qr/root\@localhost/, 'root is there';
+ is $ticket->owner, $tester->id, 'correct owner';
+ like $ticket->role_group("admin_cc")->member_emails_as_string, qr/root\@localhost/, 'root is there';
}
diag "check that previous trick doesn't work without sufficient rights"
if $ENV{'TEST_VERBOSE'};
{
RT::Test->set_rights(
- { Principal => $tester->PrincipalObj,
- Right => [qw(SeeQueue ShowTicket CreateTicket OwnTicket)],
+ { principal => $tester->principal_object,
+ right => [qw(Seequeue ShowTicket CreateTicket OwnTicket)],
},
);
my $ticket = RT::Model::Ticket->new(current_user => $tester );
# tester is owner, owner has right to modify owned tickets,
- # this right is required to set somebody as AdminCc
+ # this right is required to set somebody as Admincc
my ($tid, $txn_id, $msg) = $ticket->create(
- Queue => $queue->id,
- Owner => $tester->id,
- AdminCc => 'root at localhost',
+ queue => $queue->id,
+ owner => $tester->id,
+ admin_cc => 'root at localhost',
);
diag $msg if $msg && $ENV{'TEST_VERBOSE'};
ok $tid, "created a ticket";
- is $ticket->Owner, $tester->id, 'correct owner';
- unlike $ticket->AdminCcAddresses, qr/root\@localhost/, 'root is there';
+ is $ticket->owner, $tester->id, 'correct owner';
+ unlike $ticket->role_group("admin_cc")->member_emails_as_string, qr/root\@localhost/, 'root is there';
}
diag "check that deffering owner really works" if $ENV{'TEST_VERBOSE'};
{
RT::Test->set_rights(
- { Principal => $tester->PrincipalObj,
- Right => [qw(SeeQueue ShowTicket CreateTicket)],
+ { principal => $tester->principal_object,
+ right => [qw(Seequeue ShowTicket CreateTicket)],
},
- { Principal => $queue->Cc->PrincipalObj,
- Object => $queue,
- Right => [qw(OwnTicket TakeTicket)],
+ { principal => $queue->role_group('cc')->principal_object,
+ object => $queue,
+ right => [qw(OwnTicket TakeTicket)],
},
);
my $ticket = RT::Model::Ticket->new(current_user => $tester );
- # set tester as Cc, Cc role group has right to own and take tickets
+ # set tester as cc, cc role group has right to own and take tickets
my ($tid, $txn_id, $msg) = $ticket->create(
- Queue => $queue->id,
- Owner => $tester->id,
- Cc => 'tester at localhost',
+ queue => $queue->id,
+ owner => $tester->id,
+ cc => 'tester at localhost',
);
diag $msg if $msg && $ENV{'TEST_VERBOSE'};
ok $tid, "created a ticket";
- like $ticket->CcAddresses, qr/tester\@localhost/, 'tester is in the cc list';
- is $ticket->Owner, $tester->id, 'tester is also owner';
+ like $ticket->role_group("cc")->member_emails_as_string, qr/tester\@localhost/, 'tester is in the cc list';
+ is $ticket->owner, $tester->id, 'tester is also owner';
}
diag "check that deffering doesn't work without correct rights" if $ENV{'TEST_VERBOSE'};
{
RT::Test->set_rights(
- { Principal => $tester->PrincipalObj,
- Right => [qw(SeeQueue ShowTicket CreateTicket)],
+ { principal => $tester->principal_object,
+ right => [qw(Seequeue ShowTicket CreateTicket)],
},
);
my $ticket = RT::Model::Ticket->new(current_user => $tester );
- # set tester as Cc, Cc role group has right to own and take tickets
+ # set tester as cc, cc role group has right to own and take tickets
my ($tid, $txn_id, $msg) = $ticket->create(
- Queue => $queue->id,
- Owner => $tester->id,
- Cc => 'tester at localhost',
+ queue => $queue->id,
+ owner => $tester->id,
+ cc => 'tester at localhost',
);
diag $msg if $msg && $ENV{'TEST_VERBOSE'};
ok $tid, "created a ticket";
- like $ticket->CcAddresses, qr/tester\@localhost/, 'tester is in the cc list';
- isnt $ticket->Owner, $tester->id, 'tester is also owner';
+ like $ticket->role_group("cc")->member_emails_as_string, qr/tester\@localhost/, 'tester is in the cc list';
+ isnt $ticket->owner, $tester->id, 'tester is also owner';
}
Modified: rt/branches/3.999-DANGEROUS/t/ticket/search_long_cf_values.t
==============================================================================
--- rt/branches/3.999-DANGEROUS/t/ticket/search_long_cf_values.t (original)
+++ rt/branches/3.999-DANGEROUS/t/ticket/search_long_cf_values.t Fri Aug 22 14:43:12 2008
@@ -11,7 +11,7 @@
# setup the queue
-my $q = RT::Queue->new($RT::SystemUser);
+my $q = RT::Model::Queue->new(current_user => RT->system_user);
my $queue = 'SearchTests-'.$$;
$q->create(Name => $queue);
ok ($q->id, "Created the queue");
Modified: rt/branches/3.999-DANGEROUS/t/ticket/sort-by-queue.t
==============================================================================
--- rt/branches/3.999-DANGEROUS/t/ticket/sort-by-queue.t (original)
+++ rt/branches/3.999-DANGEROUS/t/ticket/sort-by-queue.t Fri Aug 22 14:43:12 2008
@@ -7,7 +7,7 @@
use warnings;
use RT::Model::TicketCollection;
-use RT::Queue;
+use RT::Model::Queue;
use RT::CustomField;
#########################################################
@@ -20,7 +20,7 @@
my @queues;
# create them in reverse order to avoid false positives
foreach my $name ( qw(sort-by-queue-Z sort-by-queue-A) ) {
- my $queue = RT::Queue->new( $RT::SystemUser );
+ my $queue = RT::Model::Queue->new(current_user => RT->system_user );
my ($ret, $msg) = $queue->create(
Name => $name ."-$$",
Description => 'queue to test sorting by queue'
Modified: rt/branches/3.999-DANGEROUS/t/ticket/sort-by-user.t
==============================================================================
--- rt/branches/3.999-DANGEROUS/t/ticket/sort-by-user.t (original)
+++ rt/branches/3.999-DANGEROUS/t/ticket/sort-by-user.t Fri Aug 22 14:43:12 2008
@@ -7,7 +7,7 @@
use warnings;
use RT::Model::TicketCollection;
-use RT::Queue;
+use RT::Model::Queue;
use RT::CustomField;
#########################################################
@@ -19,7 +19,7 @@
my $queue_name = "OwnerSortQueue$$";
my $queue;
{
- $queue = RT::Queue->new( $RT::SystemUser );
+ $queue = RT::Model::Queue->new(current_user => RT->system_user );
my ($ret, $msg) = $queue->create(
Name => $queue_name,
Description => 'queue for custom field sort testing'
@@ -39,9 +39,9 @@
);
ok $uid, "created user #$uid";
- my ($status, $msg) = $user->PrincipalObj->GrantRight( Right => 'OwnTicket', Object => $queue );
+ my ($status, $msg) = $user->principal_object->grant_right( Right => 'OwnTicket', Object => $queue );
ok $status, "granted right";
- ($status, $msg) = $user->PrincipalObj->GrantRight( Right => 'CreateTicket', Object => $queue );
+ ($status, $msg) = $user->principal_object->grant_right( Right => 'CreateTicket', Object => $queue );
ok $status, "granted right";
push @users, $user;
Modified: rt/branches/3.999-DANGEROUS/t/web/cf_onqueue.t
==============================================================================
--- rt/branches/3.999-DANGEROUS/t/web/cf_onqueue.t (original)
+++ rt/branches/3.999-DANGEROUS/t/web/cf_onqueue.t Fri Aug 22 14:43:12 2008
@@ -15,10 +15,10 @@
$m->title_is(q/Select a Custom Field/, 'admin-cf screen');
$m->follow_link( text => 'Create' );
$m->submit_form(
- form_name => "ModifyCustomField",
+ form_name => "modify_custom_field",
fields => {
TypeComposite => 'Freeform-1',
- LookupType => 'RT::Queue',
+ lookup_type => 'RT::Model::Queue',
Name => 'QueueCFTest',
Description => 'QueueCFTest',
},
@@ -54,9 +54,9 @@
$m->submit_form(
form_number => 3,
# The following doesn't want to works :(
- #with_fields => { 'Object-RT::Queue-1-CustomField-1-Value' },
+ #with_fields => { 'Object-RT::Model::Queue-1-CustomField-1-Value' },
fields => {
- 'Object-RT::Queue-1-CustomField-1-Value' => 'QueueCFTest content',
+ 'Object-RT::Model::Queue-1-CustomField-1-Value' => 'QueueCFTest content',
},
);
$m->content_like( qr/QueueCFTest QueueCFTest content added/, 'Content filed in CF QueueCFTest for default queue' );
Modified: rt/branches/3.999-DANGEROUS/t/web/dashboards-groups.t
==============================================================================
--- rt/branches/3.999-DANGEROUS/t/web/dashboards-groups.t (original)
+++ rt/branches/3.999-DANGEROUS/t/web/dashboards-groups.t Fri Aug 22 14:43:12 2008
@@ -14,26 +14,26 @@
$user_obj->SetName('customer');
$user_obj->SetPrivileged(1);
($ok, $msg) = $user_obj->SetPassword('customer');
-$user_obj->PrincipalObj->GrantRight(Right => 'ModifySelf');
+$user_obj->principal_object->grant_right(Right => 'ModifySelf');
my $currentuser = RT::CurrentUser->new($user_obj);
-my $queue = RT::Queue->new($RT::SystemUser);
+my $queue = RT::Model::Queue->new(current_user => RT->system_user);
$queue->create(Name => 'SearchQueue'.$$);
-$user_obj->PrincipalObj->GrantRight(Right => $_, Object => $queue)
+$user_obj->principal_object->grant_right(Right => $_, Object => $queue)
for qw/SeeQueue ShowTicket OwnTicket/;
# grant the user all these rights so we can make sure that the group rights
# are checked and not these as well
-$user_obj->PrincipalObj->GrantRight(Right => $_, Object => $RT::System)
+$user_obj->principal_object->grant_right(Right => $_, Object => $RT::System)
for qw/SubscribeDashboard CreateOwnDashboard SeeOwnDashboard ModifyOwnDashboard DeleteOwnDashboard/;
# }}}
# create and test groups (outer < inner < user) {{{
-my $inner_group = RT::Group->new($RT::SystemUser);
+my $inner_group = RT::Model::Group->new(current_user => RT->system_user);
($ok, $msg) = $inner_group->create_user_defined_group(Name => "inner", Description => "inner group");
ok($ok, "created inner group: $msg");
-my $outer_group = RT::Group->new($RT::SystemUser);
+my $outer_group = RT::Model::Group->new(current_user => RT->system_user);
($ok, $msg) = $outer_group->create_user_defined_group(Name => "outer", Description => "outer group");
ok($ok, "created outer group: $msg");
@@ -63,7 +63,7 @@
is_deeply([$m->current_form->find_input('Privacy')->possible_values], ["RT::Model::User-" . $user_obj->Id], "the only selectable privacy is user");
$m->content_lacks('Delete', "Delete button hidden because we are creating");
-$user_obj->PrincipalObj->GrantRight(Right => 'CreateGroupDashboard', Object => $inner_group);
+$user_obj->principal_object->grant_right(Right => 'CreateGroupDashboard', Object => $inner_group);
$m->follow_link_ok({text => "New dashboard"});
$m->form_name('ModifyDashboard');
@@ -90,7 +90,7 @@
$m->content_lacks("inner dashboard", "no SeeGroupDashboard right");
$m->content_contains("Permission denied");
-$user_obj->PrincipalObj->GrantRight(Right => 'SeeGroupDashboard', Object => $inner_group);
+$user_obj->principal_object->grant_right(Right => 'SeeGroupDashboard', Object => $inner_group);
$m->get_ok("/Dashboards/Modify.html?id=$id");
$m->content_contains("inner dashboard", "we now have SeeGroupDashboard right");
$m->content_lacks("Permission denied");
Modified: rt/branches/3.999-DANGEROUS/t/web/dashboards.t
==============================================================================
--- rt/branches/3.999-DANGEROUS/t/web/dashboards.t (original)
+++ rt/branches/3.999-DANGEROUS/t/web/dashboards.t Fri Aug 22 14:43:12 2008
@@ -13,14 +13,14 @@
$user_obj->SetName('customer');
$user_obj->SetPrivileged(1);
($ret, $msg) = $user_obj->SetPassword('customer');
-$user_obj->PrincipalObj->GrantRight(Right => 'ModifySelf');
+$user_obj->principal_object->grant_right(Right => 'ModifySelf');
my $currentuser = RT::CurrentUser->new($user_obj);
-my $queue = RT::Queue->new($RT::SystemUser);
+my $queue = RT::Model::Queue->new(current_user => RT->system_user);
$queue->create(Name => 'SearchQueue'.$$);
-$user_obj->PrincipalObj->GrantRight(Right => 'SeeQueue', Object => $queue);
-$user_obj->PrincipalObj->GrantRight(Right => 'ShowTicket', Object => $queue);
-$user_obj->PrincipalObj->GrantRight(Right => 'OwnTicket', Object => $queue);
+$user_obj->principal_object->grant_right(Right => 'SeeQueue', Object => $queue);
+$user_obj->principal_object->grant_right(Right => 'ShowTicket', Object => $queue);
+$user_obj->principal_object->grant_right(Right => 'OwnTicket', Object => $queue);
ok $m->login(customer => 'customer'), "logged in";
@@ -31,14 +31,14 @@
$m->content_contains("Permission denied");
$m->content_lacks("Save Changes");
-$user_obj->PrincipalObj->GrantRight(Right => 'ModifyOwnDashboard', Object => $RT::System);
+$user_obj->principal_object->grant_right(Right => 'ModifyOwnDashboard', Object => $RT::System);
# Modify itself is no longer good enough, you need Create
$m->get_ok($url."Dashboards/Modify.html?Create=1");
$m->content_contains("Permission denied");
$m->content_lacks("Save Changes");
-$user_obj->PrincipalObj->GrantRight(Right => 'CreateOwnDashboard', Object => $RT::System);
+$user_obj->principal_object->grant_right(Right => 'CreateOwnDashboard', Object => $RT::System);
$m->get_ok($url."Dashboards/Modify.html?Create=1");
$m->content_lacks("Permission denied");
@@ -59,7 +59,7 @@
$m->get_ok($url."Dashboards/index.html");
$m->content_lacks("different dashboard", "we lack SeeOwnDashboard");
-$user_obj->PrincipalObj->GrantRight(Right => 'SeeOwnDashboard', Object => $RT::System);
+$user_obj->principal_object->grant_right(Right => 'SeeOwnDashboard', Object => $RT::System);
$m->get_ok($url."Dashboards/index.html");
$m->content_contains("different dashboard", "we now have SeeOwnDashboard");
@@ -136,7 +136,7 @@
RT::Record->FlushCache if RT::Record->can('FlushCache');
is($user_obj->Attributes->Named('Subscription'), 0, "no subscriptions");
-$user_obj->PrincipalObj->GrantRight(Right => 'SubscribeDashboard', Object => $RT::System);
+$user_obj->principal_object->grant_right(Right => 'SubscribeDashboard', Object => $RT::System);
$m->get_ok("/Dashboards/Modify.html?id=$id");
$m->follow_link_ok({text => "Subscription"});
@@ -163,7 +163,7 @@
$m->get_ok("/Dashboards/Modify.html?id=$id&Delete=1");
$m->content_contains("Permission denied", "unable to delete dashboard because we lack DeleteOwnDashboard");
-$user_obj->PrincipalObj->GrantRight(Right => 'DeleteOwnDashboard', Object => $RT::System);
+$user_obj->principal_object->grant_right(Right => 'DeleteOwnDashboard', Object => $RT::System);
$m->get_ok("/Dashboards/Modify.html?id=$id");
$m->content_contains('Delete', "Delete button shows because we have DeleteOwnDashboard");
More information about the Rt-commit
mailing list