X-Git-Url: http://git.freeside.biz/gitweb/?p=freeside.git;a=blobdiff_plain;f=rt%2Ft%2Fticket%2Fdeferred_owner.t;fp=rt%2Ft%2Fticket%2Fdeferred_owner.t;h=fe90d539d8eb48bb34170e78a133d5b317cfd002;hp=40172caf971a4d408deec0605732bf4b5724b82e;hb=43a06151e47d2c59b833cbd8c26d97865ee850b6;hpb=6587f6ba7d047ddc1686c080090afe7d53365bd4 diff --git a/rt/t/ticket/deferred_owner.t b/rt/t/ticket/deferred_owner.t index 40172caf9..fe90d539d 100644 --- a/rt/t/ticket/deferred_owner.t +++ b/rt/t/ticket/deferred_owner.t @@ -2,7 +2,7 @@ use strict; use warnings; -use RT::Test tests => 18; +use RT::Test nodata => 1, tests => 18; use_ok('RT'); use_ok('RT::Ticket'); use Test::Warn; @@ -16,11 +16,11 @@ ok $tester && $tester->id, 'loaded or created user'; 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 ); +my $owner_role_group = RT::Group->new( RT->SystemUser ); $owner_role_group->LoadQueueRoleGroup( 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'}; +diag "check that deffering owner doesn't regress"; { RT::Test->set_rights( { Principal => $tester->PrincipalObj, @@ -39,14 +39,13 @@ diag "check that deffering owner doesn't regress" if $ENV{'TEST_VERBOSE'}; Owner => $tester->id, AdminCc => 'root@localhost', ); - diag $msg if $msg && $ENV{'TEST_VERBOSE'}; + diag $msg if $msg; ok $tid, "created a ticket"; is $ticket->Owner, $tester->id, 'correct owner'; like $ticket->AdminCcAddresses, qr/root\@localhost/, 'root is there'; } -diag "check that previous trick doesn't work without sufficient rights" - if $ENV{'TEST_VERBOSE'}; +diag "check that previous trick doesn't work without sufficient rights"; { RT::Test->set_rights( { Principal => $tester->PrincipalObj, @@ -61,13 +60,13 @@ diag "check that previous trick doesn't work without sufficient rights" Owner => $tester->id, AdminCc => 'root@localhost', ); - diag $msg if $msg && $ENV{'TEST_VERBOSE'}; + diag $msg if $msg; ok $tid, "created a ticket"; is $ticket->Owner, $tester->id, 'correct owner'; unlike $ticket->AdminCcAddresses, qr/root\@localhost/, 'root is there'; } -diag "check that deffering owner really works" if $ENV{'TEST_VERBOSE'}; +diag "check that deffering owner really works"; { RT::Test->set_rights( { Principal => $tester->PrincipalObj, @@ -85,13 +84,13 @@ diag "check that deffering owner really works" if $ENV{'TEST_VERBOSE'}; Owner => $tester->id, Cc => 'tester@localhost', ); - diag $msg if $msg && $ENV{'TEST_VERBOSE'}; + diag $msg if $msg; 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'; } -diag "check that deffering doesn't work without correct rights" if $ENV{'TEST_VERBOSE'}; +diag "check that deffering doesn't work without correct rights"; { RT::Test->set_rights( { Principal => $tester->PrincipalObj, @@ -110,7 +109,7 @@ diag "check that deffering doesn't work without correct rights" if $ENV{'TEST_VE ); } qr/User .* was proposed as a ticket owner but has no rights to own tickets in General/; - diag $msg if $msg && $ENV{'TEST_VERBOSE'}; + diag $msg if $msg; 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';