5 use RT::Test tests => 26;
7 my ( $url, $m ) = RT::Test->started_ok;
8 ok( $m->login(), 'logged in' );
11 diag "test creating a group" if $ENV{TEST_VERBOSE};
12 $m->get_ok( $url . '/Admin/Groups/Modify.html?Create=1' );
13 $m->content_contains('Create a new group', 'found title');
16 fields => { Name => 'test group' },
18 $m->content_contains('Group created', 'found results');
19 $m->content_contains('Modify the group test group', 'found title');
23 diag "test creating another group" if $ENV{TEST_VERBOSE};
24 $m->get_ok( $url . '/Admin/Groups/Modify.html?Create=1' );
25 $m->content_contains('Create a new group', 'found title');
28 fields => { Name => 'test group2' },
30 $m->content_contains('Group created', 'found results');
31 $m->content_contains('Modify the group test group2', 'found title');
35 diag "test creating an overlapping group" if $ENV{TEST_VERBOSE};
36 $m->get_ok( $url . '/Admin/Groups/Modify.html?Create=1' );
37 $m->content_contains('Create a new group', 'found title');
40 fields => { Name => 'test group' },
42 $m->content_contains('Group could not be created', 'found results');
43 $m->content_like(qr/Group name .+? is already in use/, 'found message');
47 diag "test updating a group name to overlap" if $ENV{TEST_VERBOSE};
48 $m->get_ok( $url . '/Admin/Groups/' );
49 $m->follow_link_ok({text => 'test group2'}, 'found title');
50 $m->content_contains('Modify the group test group2');
53 fields => { Name => 'test group' },
55 $m->content_lacks('Name changed', "name not changed");
56 $m->content_contains('Illegal value for Name', 'found error message');
57 $m->content_contains('test group', 'did not find new name');