projects
/
freeside.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
more robust testing platform, #37340
[freeside.git]
/
rt
/
t
/
ticket
/
deferred_owner.t
diff --git
a/rt/t/ticket/deferred_owner.t
b/rt/t/ticket/deferred_owner.t
index
fe90d53
..
a0aa350
100644
(file)
--- a/
rt/t/ticket/deferred_owner.t
+++ b/
rt/t/ticket/deferred_owner.t
@@
-1,10
+1,7
@@
-
use strict;
use warnings;
use strict;
use warnings;
-use RT::Test nodata => 1, tests => 18;
-use_ok('RT');
-use_ok('RT::Ticket');
+use RT::Test nodata => 1, tests => undef;
use Test::Warn;
use Test::Warn;
@@
-16,8
+13,7
@@
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 $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 = $queue->RoleGroup( 'Owner' );
ok $owner_role_group->id, 'loaded owners role group of the queue';
diag "check that deffering owner doesn't regress";
ok $owner_role_group->id, 'loaded owners role group of the queue';
diag "check that deffering owner doesn't regress";
@@
-63,7
+59,7
@@
diag "check that previous trick doesn't work without sufficient rights";
diag $msg if $msg;
ok $tid, "created a ticket";
is $ticket->Owner, $tester->id, 'correct owner';
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';
+ unlike $ticket->AdminCcAddresses, qr/root\@localhost/, 'root is
not
there';
}
diag "check that deffering owner really works";
}
diag "check that deffering owner really works";
@@
-88,6
+84,9
@@
diag "check that deffering owner really works";
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';
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';
+ my $owners = $ticket->OwnerGroup->MembersObj;
+ is $owners->Count, 1, 'one record in owner group';
+ is $owners->First->MemberObj->Id, $tester->id, 'and it is tester';
}
diag "check that deffering doesn't work without correct rights";
}
diag "check that deffering doesn't work without correct rights";
@@
-112,8
+111,10
@@
diag "check that deffering doesn't work without correct rights";
diag $msg if $msg;
ok $tid, "created a ticket";
like $ticket->CcAddresses, qr/tester\@localhost/, 'tester is in the cc list';
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';
+ is $ticket->Owner, RT->Nobody->id, 'nobody is the owner';
+ my $owners = $ticket->OwnerGroup->MembersObj;
+ is $owners->Count, 1, 'one record in owner group';
+ is $owners->First->MemberObj->Id, RT->Nobody->id, 'and it is nobody';
}
}
-
-
+done_testing;