diff options
author | Ivan Kohler <ivan@freeside.biz> | 2012-07-08 22:45:58 -0700 |
---|---|---|
committer | Ivan Kohler <ivan@freeside.biz> | 2012-07-08 22:45:58 -0700 |
commit | a6fe07e49e3fc12169e801b1ed6874c3a5bd8500 (patch) | |
tree | b87a7e6f37da5c8e13eb4d4653cfc8ce9239d8f0 /rt/t/web/group_create.t | |
parent | e27244386c346f459d1569db26344407a0372a05 (diff) | |
parent | 005424d0c899aa899f43f583a6c74deb13ea4be1 (diff) |
Merge branch 'master' of git.freeside.biz:/home/git/freeside
Conflicts:
httemplate/misc/process/cancel_pkg.html
Diffstat (limited to 'rt/t/web/group_create.t')
-rw-r--r-- | rt/t/web/group_create.t | 75 |
1 files changed, 75 insertions, 0 deletions
diff --git a/rt/t/web/group_create.t b/rt/t/web/group_create.t new file mode 100644 index 000000000..26da59268 --- /dev/null +++ b/rt/t/web/group_create.t @@ -0,0 +1,75 @@ +#!/usr/bin/perl + +use strict; +use warnings; + +use RT::Test tests => 13; + +my ( $baseurl, $m ) = RT::Test->started_ok; +ok $m->login, 'logged in as root'; +my $root = RT::User->new(RT->SystemUser); +ok( $root->Load('root'), 'load root user' ); + +my $group_name = 'test group'; + +my $group_id; +diag "Create a group"; +{ + $m->follow_link( id => 'tools-config-groups-create'); + + # Test group form validation + $m->submit_form( + form_name => 'ModifyGroup', + fields => { + Name => '', + }, + ); + $m->text_contains('Name is required'); + $m->submit_form( + form_name => 'ModifyGroup', + fields => { + Name => '0', + }, + ); + $m->text_contains('Could not create group'); + $m->submit_form( + form_name => 'ModifyGroup', + fields => { + Name => '1', + }, + ); + $m->text_contains('Could not create group'); + $m->submit_form( + form_name => 'ModifyGroup', + fields => { + Name => $group_name, + }, + ); + $m->content_contains('Group created', 'created group sucessfully' ); + + # Test validation on updae + $m->form_name('ModifyGroup'); + $m->set_fields( + Name => '', + ); + $m->click_button(value => 'Save Changes'); + $m->text_contains('Illegal value for Name'); + + $m->form_name('ModifyGroup'); + $m->set_fields( + Name => '0', + ); + $m->click_button(value => 'Save Changes'); + $m->text_contains('Illegal value for Name'); + + $m->form_name('ModifyGroup'); + $m->set_fields( + Name => '1', + ); + $m->click_button(value => 'Save Changes'); + $m->text_contains('Illegal value for Name'); + + $group_id = $m->form_name('ModifyGroup')->value('id'); + ok $group_id, "found id of the group in the form, it's #$group_id"; +} + |