4 use RT::Test tests => 26;
6 my ( $url, $m ) = RT::Test->started_ok;
7 ok( $m->login(), 'logged in' );
10 diag "test creating a group" if $ENV{TEST_VERBOSE};
11 $m->get_ok( $url . '/Admin/Groups/Modify.html?Create=1' );
12 $m->content_contains('Create a new group', 'found title');
15 fields => { Name => 'test group' },
17 $m->content_contains('Group created', 'found results');
18 $m->content_contains('Modify the group test group', 'found title');
22 diag "test creating another group" if $ENV{TEST_VERBOSE};
23 $m->get_ok( $url . '/Admin/Groups/Modify.html?Create=1' );
24 $m->content_contains('Create a new group', 'found title');
27 fields => { Name => 'test group2' },
29 $m->content_contains('Group created', 'found results');
30 $m->content_contains('Modify the group test group2', 'found title');
34 diag "test creating an overlapping group" if $ENV{TEST_VERBOSE};
35 $m->get_ok( $url . '/Admin/Groups/Modify.html?Create=1' );
36 $m->content_contains('Create a new group', 'found title');
39 fields => { Name => 'test group' },
41 $m->content_contains('Group could not be created', 'found results');
42 $m->content_like(qr/Group name .+? is already in use/, 'found message');
46 diag "test updating a group name to overlap" if $ENV{TEST_VERBOSE};
47 $m->get_ok( $url . '/Admin/Groups/' );
48 $m->follow_link_ok({text => 'test group2'}, 'found title');
49 $m->content_contains('Modify the group test group2');
52 fields => { Name => 'test group' },
54 $m->content_lacks('Name changed', "name not changed");
55 $m->content_contains('Illegal value for Name', 'found error message');
56 $m->content_contains('test group', 'did not find new name');