Skip to content

Commit

Permalink
removed redundant tests
Browse files Browse the repository at this point in the history
  • Loading branch information
kraih committed Aug 11, 2012
1 parent 6438114 commit cf7d8c3
Showing 1 changed file with 7 additions and 22 deletions.
29 changes: 7 additions & 22 deletions t/mojolicious/lite_app.t
Expand Up @@ -9,7 +9,7 @@ BEGIN {
$ENV{MOJO_REACTOR} = 'Mojo::Reactor::Poll';
}

use Test::More tests => 712;
use Test::More tests => 704;

# "Wait you're the only friend I have...
# You really want a robot for a friend?
Expand Down Expand Up @@ -209,8 +209,8 @@ get '/stream' => sub {
my $finished;
get '/finished' => sub {
my $self = shift;
$self->on(finish => sub { $finished += 3 });
$finished = 20;
$self->on(finish => sub { $finished += 2 });
$finished = 1;
$self->render(text => 'so far so good!');
};

Expand Down Expand Up @@ -296,13 +296,6 @@ post '/with/header/condition' => sub {
$self->render_text('foo ' . $self->req->headers->header('X-Secret-Header'));
} => (headers => {'X-Secret-Header' => 'bar'});

# POST /echo/body
post '/echo/body' => sub {
my $self = shift;
$self->res->headers->header(Echo => $self->req->headers->header('Echo'));
$self->render_text($self->req->body);
};

# GET /session_cookie
get '/session_cookie' => sub {
my $self = shift;
Expand Down Expand Up @@ -384,8 +377,8 @@ post '/utf8' => 'form';

# POST /malformed_UTF-8
post '/malformed_utf8' => sub {
my $c = shift;
$c->render_text(b($c->param('foo'))->url_escape->to_string);
my $self = shift;
$self->render_text(b($self->param('foo'))->url_escape->to_string);
};

# GET /json
Expand All @@ -396,7 +389,7 @@ get '/json' =>
get '/autostash' => sub { shift->render(handler => 'ep', foo => 'bar') };

# GET /app
get '/app' => {layout => 'app'};
get app => {layout => 'app'};

# GET /helper
get '/helper' => sub { shift->render(handler => 'ep') } => 'helper';
Expand Down Expand Up @@ -840,7 +833,7 @@ $t->get_ok('/finished')->status_is(200)
->header_is(Server => 'Mojolicious (Perl)')
->header_is('X-Powered-By' => 'Mojolicious (Perl)')
->content_is('so far so good!');
is $finished, 23, 'finished';
is $finished, 3, 'finished';

# GET / (IRI)
$t->get_ok('/привет/мир')->status_is(200)
Expand Down Expand Up @@ -967,14 +960,6 @@ $t->post_ok('/with/header/condition' => {'X-Secret-Header' => 'bar'} => 'bar')
$t->post_ok('/with/header/condition' => {} => 'bar')->status_is(404)
->content_like(qr/Oops!/);

# POST /echo/body (description and no header)
$t->post_ok('/echo/body' => 'foo' => 'header missing')->status_is(200)
->header_isnt(Echo => 'bar')->content_is('foo');

# POST /echo/body (description and header)
$t->post_ok('/echo/body' => {Echo => 'bar'} => 'foo' => 'header present')
->status_is(200)->header_is(Echo => 'bar')->content_is('foo');

# GET /session_cookie
$t->get_ok('/session_cookie')->status_is(200)
->header_is(Server => 'Mojolicious (Perl)')
Expand Down

0 comments on commit cf7d8c3

Please sign in to comment.