Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
added query string roundtrip test
  • Loading branch information
kraih committed Jul 4, 2012
1 parent 1e55649 commit d0aca8f
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 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 => 692;
use Test::More tests => 697;

# "Wait you're the only friend I have...
# You really want a robot for a friend?
Expand Down Expand Up @@ -104,6 +104,12 @@ get '/auto_name' => sub {
$self->render(text => $self->url_for('auto_name'));
};

# GET /query_string
get '/query_string' => sub {
my $self = shift;
$self->render_text(b($self->req->url->query)->url_unescape);
};

# GET /reserved
get '/reserved' => sub {
my $self = shift;
Expand Down Expand Up @@ -679,6 +685,12 @@ $t->get_ok('/auto_name')->status_is(200)
->header_is('X-Powered-By' => 'Mojolicious (Perl)')
->content_is('/custom_name');

# GET /query_string (query string roundtrip)
$t->get_ok('/query_string?http://mojolicio.us/perldoc?foo=bar')->status_is(200)
->header_is(Server => 'Mojolicious (Perl)')
->header_is('X-Powered-By' => 'Mojolicious (Perl)')
->content_is('http://mojolicio.us/perldoc?foo=bar');

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

0 comments on commit d0aca8f

Please sign in to comment.