Skip to content

Commit

Permalink
test custom request methods
Browse files Browse the repository at this point in the history
  • Loading branch information
kraih committed Mar 23, 2015
1 parent 2e7cdf0 commit fe9fb1e
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions t/mojolicious/lite_app.t
Expand Up @@ -300,7 +300,7 @@ any '/something' => sub {
$c->render(text => 'Just works!');
};

any [qw(get post)] => '/something/else' => sub {
any [qw(get post whatever)] => '/something/else' => sub {
my $c = shift;
$c->render(text => 'Yay!');
};
Expand Down Expand Up @@ -817,11 +817,14 @@ $t->post_ok('/something')->status_is(200)
$t->delete_ok('/something')->status_is(200)
->header_is(Server => 'Mojolicious (Perl)')->content_is('Just works!');

# Only GET and POST
# Only GET, POST and a custom request method
$t->get_ok('/something/else')->status_is(200)
->header_is(Server => 'Mojolicious (Perl)')->content_is('Yay!');
$t->post_ok('/something/else')->status_is(200)
->header_is(Server => 'Mojolicious (Perl)')->content_is('Yay!');
$t->request_ok($t->ua->build_tx(WHATEVER => '/something/else'))
->status_is(200)->header_is(Server => 'Mojolicious (Perl)')
->content_is('Yay!');
$t->delete_ok('/something/else')->status_is(404)
->header_is(Server => 'Mojolicious (Perl)')->content_like(qr/Oops!/);

Expand Down

0 comments on commit fe9fb1e

Please sign in to comment.