Skip to content

Commit

Permalink
better multi name tests
Browse files Browse the repository at this point in the history
  • Loading branch information
kraih committed Jul 24, 2012
1 parent d2f85a3 commit b66d565
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion t/mojolicious/lite_app.t
Expand Up @@ -9,7 +9,7 @@ BEGIN {
$ENV{MOJO_REACTOR} = 'Mojo::Reactor::Poll';
}

use Test::More tests => 708;
use Test::More tests => 713;

# "Wait you're the only friend I have...
# You really want a robot for a friend?
Expand Down Expand Up @@ -117,6 +117,7 @@ get '/query_string' => sub {
get '/multi/:bar' => sub {
my $self = shift;
my ($foo, $bar, $baz) = $self->param([qw(foo bar baz)]);
$foo //= '';
$self->render(
data => join('', $foo, $bar, $baz),
test => $self->param(['yada'])
Expand Down Expand Up @@ -714,6 +715,11 @@ $t->get_ok('/multi/B?foo=A&foo=E&baz=C&yada=D&yada=text&yada=fail')
->status_is(200)->header_is(Server => 'Mojolicious (Perl)')
->header_is('X-Powered-By' => 'Mojolicious (Perl)')->content_is('ABC');

# GET /multi/B (missing parameter)
$t->get_ok('/multi/B?baz=C')->status_is(200)
->header_is(Server => 'Mojolicious (Perl)')
->header_is('X-Powered-By' => 'Mojolicious (Perl)')->content_is('BC');

# GET /reserved
$t->get_ok('/reserved?data=just-works')->status_is(200)
->header_is(Server => 'Mojolicious (Perl)')
Expand Down

0 comments on commit b66d565

Please sign in to comment.