summaryrefslogtreecommitdiff
path: root/rt/t/web/requestor_groups_limit.t
blob: abc21cad7cfcd225e21a520c2bd966cfaf5fd699 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35

use strict;
use warnings;

use RT::Test tests => 11;

diag "set groups limit to 1";
RT->Config->Set( ShowMoreAboutPrivilegedUsers    => 1 );
RT->Config->Set( MoreAboutRequestorGroupsLimit => 1 );

my $ticket = RT::Ticket->new(RT->SystemUser);
my ($id) = $ticket->Create(
    Subject   => 'groups limit',
    Queue     => 'General',
    Requestor => 'root@localhost',
);
ok( $id, 'created ticket' );

my ( $url, $m ) = RT::Test->started_ok;
ok( $m->login(), 'logged in as root' );
$m->goto_ticket($id);
$m->content_like( qr/Everyone|Privileged/, 'got one group' );
$m->content_unlike( qr/Everyone.*?Privileged/, 'not 2 groups' );

RT::Test->stop_server;

diag "set groups limit to 2";

RT->Config->Set( MoreAboutRequestorGroupsLimit => 2 );
( $url, $m ) = RT::Test->started_ok;
ok( $m->login(), 'logged in as root' );
$m->goto_ticket($id);
$m->content_contains( 'Everyone', 'got the first group' );
$m->content_contains( 'Privileged', 'got the second group' );