Skip to content

Commit

Permalink
test missing form as well
Browse files Browse the repository at this point in the history
  • Loading branch information
kraih committed Dec 4, 2013
1 parent 37a1c8d commit 230d86f
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions t/mojolicious/validation_lite_app.t
Expand Up @@ -200,6 +200,11 @@ $t->get_ok('/forgery')->status_is(200)
->content_unlike(qr/Wrong or missing CSRF token!/)
->element_exists_not('.field-with-error');

# Correct CSRF token and missing form
$t->post_ok('/forgery' => {'X-CSRF-Token' => $token})->status_is(200)
->content_unlike(qr/Wrong or missing CSRF token!/)
->element_exists('.field-with-error');

# Failed validation for all fields (with custom helper)
$t->app->helper(
tag_with_error => sub {
Expand Down

0 comments on commit 230d86f

Please sign in to comment.