Skip to content

Commit

Permalink
added a few more under tests
Browse files Browse the repository at this point in the history
  • Loading branch information
kraih committed Sep 21, 2011
1 parent 19baa22 commit fbe4558
Showing 1 changed file with 19 additions and 4 deletions.
23 changes: 19 additions & 4 deletions t/mojolicious/lite_app.t
Expand Up @@ -10,7 +10,7 @@ BEGIN {
$ENV{MOJO_MODE} = 'development';
}

use Test::More tests => 908;
use Test::More tests => 914;

# Pollution
123 =~ m/(\d+)/;
Expand Down Expand Up @@ -744,18 +744,27 @@ under sub {
# GET /impossible
get '/impossible' => 'impossible';

# Prefix
# /prefix (prefix)
under '/prefix';

# GET
# GET /prefix
get sub { shift->render(text => 'prefixed GET works!') };

# POST
# POST /prefix
post sub { shift->render(text => 'prefixed POST works!') };

# GET /prefix/works
get '/works' => sub { shift->render(text => 'prefix works!') };

# /prefix2 (another prefix)
under '/prefix2' => {message => 'prefixed'};

# GET /prefix2/foo
get '/foo' => {inline => '<%= $message %>!'};

# GET /prefix2/bar
get '/bar' => {inline => 'also <%= $message %>!'};

# Reset
under;

Expand Down Expand Up @@ -1825,6 +1834,12 @@ $t->get_ok('/prefix/works')->status_is(200)
->header_is('X-Powered-By' => 'Mojolicious (Perl)')
->content_is('prefix works!');

# GET /prefix2/foo
$t->get_ok('/prefix2/foo')->status_is(200)->content_is("prefixed!\n");

# GET /prefix2/bar
$t->get_ok('/prefix2/bar')->status_is(200)->content_is("also prefixed!\n");

# GET /reset
$t->get_ok('/reset')->status_is(200)->content_is('reset works!');

Expand Down

0 comments on commit fbe4558

Please sign in to comment.