Skip to content

Commit d137a5c

Browse files
committed
Test status rights cleanup
1 parent b2ec907 commit d137a5c

File tree

1 file changed

+36
-1
lines changed

1 file changed

+36
-1
lines changed

t/web/lifecycle_rights.t

Lines changed: 36 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,10 @@ use strict;
22
use warnings;
33

44
BEGIN {require './t/lifecycles/utils.pl'};
5+
my ( $url, $agent ) = RT::Test->started_ok;
56

67
diag 'Test web UI for ticket status without SeeQueue right';
78
{
8-
my ( $url, $agent ) = RT::Test->started_ok;
99

1010
my $delivery = RT::Test->load_or_create_queue(
1111
Name => 'delivery',
@@ -48,4 +48,39 @@ diag 'Test web UI for ticket status without SeeQueue right';
4848

4949
}
5050

51+
diag 'Test status rights cleanup';
52+
{
53+
ok( $agent->login( 'root', 'password', logout => 1 ), 'logged in as root' );
54+
$agent->get_ok('/Admin/Lifecycles/Rights.html?Type=ticket;Name=default');
55+
56+
$agent->submit_form_ok(
57+
{ form_name => 'ModifyLifecycleRights',
58+
fields => {
59+
'Right-From-1' => '*',
60+
'Right-To-1' => 'stalled',
61+
'Right-Name-1' => 'StallTicket',
62+
},
63+
button => 'Update',
64+
},
65+
'Created StallTicket right'
66+
);
67+
$agent->text_contains('Lifecycle updated');
68+
69+
$agent->get_ok('/Admin/Global/GroupRights.html');
70+
$agent->text_contains('StallTicket', 'New right shows up on Rights page');
71+
72+
$agent->get_ok('/Admin/Lifecycles/Rights.html?Type=ticket;Name=default');
73+
$agent->submit_form_ok(
74+
{ form_name => 'ModifyLifecycleRights',
75+
fields => { 'Delete-1' => 1, },
76+
button => 'Update',
77+
},
78+
'Deleted StallTicket right'
79+
);
80+
$agent->text_contains('Lifecycle updated');
81+
82+
$agent->get_ok('/Admin/Global/GroupRights.html');
83+
$agent->text_lacks('StallTicket', 'Deleted right is gone on Rights page');
84+
}
85+
5186
done_testing;

0 commit comments

Comments
 (0)