X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=rt%2Ft%2Fapi%2Fqueue.t;h=71efb4d39a9bca7759b2c06dcc40be555865f00d;hb=681a340f6be4184b1472a8e1fa9cd5d074f6f325;hp=44d5cafceaec95fa5a77eefd36d99634ddd00c2f;hpb=63a268637b2d51a8766412617724b9436439deb6;p=freeside.git diff --git a/rt/t/api/queue.t b/rt/t/api/queue.t index 44d5cafce..71efb4d39 100644 --- a/rt/t/api/queue.t +++ b/rt/t/api/queue.t @@ -2,7 +2,7 @@ use strict; use warnings; use RT; -use RT::Test tests => 24; +use RT::Test nodata => 1, tests => undef; { @@ -14,7 +14,7 @@ use RT::Queue; { -my $q = RT::Queue->new($RT::SystemUser); +my $q = RT::Queue->new(RT->SystemUser); is($q->IsValidStatus('new'), 1, 'New is a valid status'); is($q->IsValidStatus('f00'), 0, 'f00 is not a valid status'); @@ -23,7 +23,7 @@ is($q->IsValidStatus('f00'), 0, 'f00 is not a valid status'); { -my $q = RT::Queue->new($RT::SystemUser); +my $q = RT::Queue->new(RT->SystemUser); is($q->IsActiveStatus('new'), 1, 'New is a Active status'); is($q->IsActiveStatus('rejected'), 0, 'Rejected is an inactive status'); is($q->IsActiveStatus('f00'), 0, 'f00 is not a Active status'); @@ -33,7 +33,7 @@ is($q->IsActiveStatus('f00'), 0, 'f00 is not a Active status'); { -my $q = RT::Queue->new($RT::SystemUser); +my $q = RT::Queue->new(RT->SystemUser); is($q->IsInactiveStatus('new'), 0, 'New is a Active status'); is($q->IsInactiveStatus('rejected'), 1, 'rejeected is an Inactive status'); is($q->IsInactiveStatus('f00'), 0, 'f00 is not a Active status'); @@ -43,7 +43,7 @@ is($q->IsInactiveStatus('f00'), 0, 'f00 is not a Active status'); { -my $queue = RT::Queue->new($RT::SystemUser); +my $queue = RT::Queue->new(RT->SystemUser); my ($id, $val) = $queue->Create( Name => 'Test1'); ok($id, $val); @@ -55,11 +55,10 @@ ok(!$id, $val); { -my $Queue = RT::Queue->new($RT::SystemUser); +my $Queue = RT::Queue->new(RT->SystemUser); my ($id, $msg) = $Queue->Create(Name => "Foo"); ok ($id, "Foo $id was created"); -ok(my $group = RT::Group->new($RT::SystemUser)); -ok($group->LoadQueueRoleGroup(Queue => $id, Type=> 'Requestor')); +ok(my $group = $Queue->RoleGroup('Requestor')); ok ($group->Id, "Found the requestors object for this Queue"); { @@ -67,7 +66,7 @@ ok ($group->Id, "Found the requestors object for this Queue"); ok ($status, "Added bob at fsck.com as a requestor") or diag "error: $msg"; } -ok(my $bob = RT::User->new($RT::SystemUser), "Creating a bob rt::user"); +ok(my $bob = RT::User->new(RT->SystemUser), "Creating a bob rt::user"); $bob->LoadByEmail('bob@fsck.com'); ok($bob->Id, "Found the bob rt user"); ok ($Queue->IsWatcher(Type => 'Cc', PrincipalId => $bob->PrincipalId), "The Queue actually has bob at fsck.com as a requestor"); @@ -79,14 +78,12 @@ ok ($Queue->IsWatcher(Type => 'Cc', PrincipalId => $bob->PrincipalId), "The Queu "The Queue no longer has bob at fsck.com as a requestor"); } -$group = RT::Group->new($RT::SystemUser); -ok($group->LoadQueueRoleGroup(Queue => $id, Type=> 'Cc')); +$group = $Queue->RoleGroup('Cc'); ok ($group->Id, "Found the cc object for this Queue"); -$group = RT::Group->new($RT::SystemUser); -ok($group->LoadQueueRoleGroup(Queue => $id, Type=> 'AdminCc')); +$group = $Queue->RoleGroup('AdminCc'); ok ($group->Id, "Found the AdminCc object for this Queue"); } -1; +done_testing;