diff options
-rw-r--r-- | qa/t/test_create_user_accounts.t | 24 |
1 files changed, 22 insertions, 2 deletions
diff --git a/qa/t/test_create_user_accounts.t b/qa/t/test_create_user_accounts.t index 92145f18c..d9c0c4404 100644 --- a/qa/t/test_create_user_accounts.t +++ b/qa/t/test_create_user_accounts.t @@ -63,8 +63,28 @@ foreach my $account (@accounts) { $sel->is_text_present_ok("User account creation has been restricted."); } -# These accounts are illegal. -@accounts = ('test\bugzilla@bugzilla.test', 'test@bugzilla.org@bugzilla.test', 'test@bugzilla..test'); +# These accounts are illegal and should cause a javascript alert. +@accounts = qw( + test\bugzilla@bugzilla.test + testbugzilla.test + test@bugzilla + test@bugzilla. + 'test'@bugzilla.test + test&test@bugzilla.test + [test]@bugzilla.test +); +foreach my $account (@accounts) { + $sel->click_ok("link=New Account"); + $sel->wait_for_page_to_load_ok(WAIT_TIME); + $sel->title_is("Create a new Bugzilla account"); + $sel->type_ok("login", $account); + $sel->click_ok('//input[@value="Create Account"]'); + ok($sel->get_alert() =~ /The e-mail address doesn't pass our syntax checking for a legal email address/, + 'Invalid email address detected'); +} + +# These accounts are illegal but do not cause a javascript alert +@accounts = ('test@bugzilla.org@bugzilla.test', 'test@bugzilla..test'); foreach my $account (@accounts) { $sel->click_ok("link=New Account"); $sel->wait_for_page_to_load_ok(WAIT_TIME); |