Skip to content

Commit

Permalink
test tweaks
Browse files Browse the repository at this point in the history
  • Loading branch information
kraih committed Nov 22, 2012
1 parent 64cd88d commit 6112d18
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 12 deletions.
3 changes: 3 additions & 0 deletions Changes
@@ -1,4 +1,7 @@

3.61 2012-11-23
- Improved tests.

3.60 2012-11-22
- Added unexpected event to Mojo::Transaction::HTTP.
- Improved documentation.
Expand Down
2 changes: 1 addition & 1 deletion lib/Mojo/Transaction/HTTP.pm
Expand Up @@ -13,7 +13,7 @@ sub client_read {

# Unexpected 1xx reponse
return $self->{state} = 'finished'
if $res->headers->upgrade || !$res->is_status_class(100);
if !$res->is_status_class(100) || $res->headers->upgrade;
$self->res($res->new)->emit(unexpected => $res);
$self->client_read($res->leftovers) if $res->has_leftovers;
}
Expand Down
2 changes: 1 addition & 1 deletion lib/Mojolicious.pm
Expand Up @@ -38,7 +38,7 @@ has static => sub { Mojolicious::Static->new };
has types => sub { Mojolicious::Types->new };

our $CODENAME = 'Rainbow';
our $VERSION = '3.60';
our $VERSION = '3.61';

sub AUTOLOAD {
my $self = shift;
Expand Down
1 change: 0 additions & 1 deletion t/mojo/response.t
Expand Up @@ -5,7 +5,6 @@ use IO::Compress::Gzip 'gzip';
use Mojo::Asset::File;
use Mojo::Content::Single;
use Mojo::Content::MultiPart;
use Mojo::Headers;
use Mojo::JSON;
use Mojo::Message::Response;

Expand Down
13 changes: 4 additions & 9 deletions t/mojolicious/lite_app.t
Expand Up @@ -13,7 +13,6 @@ use Test::More;
use Mojo::ByteStream 'b';
use Mojo::Cookie::Response;
use Mojo::IOLoop;
use Mojo::JSON;
use Mojolicious::Lite;
use Test::Mojo;

Expand Down Expand Up @@ -1040,14 +1039,10 @@ $t->post_form_ok(
->content_is("табак ангел\n");

# POST /malformed_utf8
my $tx = $t->ua->post('/malformed_utf8' =>
{'Content-Type' => 'application/x-www-form-urlencoded'} => 'foo=%E1');
is $tx->res->code, 200, 'right status';
is scalar $tx->res->headers->server, 'Mojolicious (Perl)',
'right "Server" value';
is scalar $tx->res->headers->header('X-Powered-By'), 'Mojolicious (Perl)',
'right "X-Powered-By" value';
is $tx->res->body, '%E1', 'right content';
$t->post_ok('/malformed_utf8' =>
{'Content-Type' => 'application/x-www-form-urlencoded'} => 'foo=%E1')
->status_is(200)->header_is(Server => 'Mojolicious (Perl)')
->header_is('X-Powered-By' => 'Mojolicious (Perl)')->content_is('%E1');

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

0 comments on commit 6112d18

Please sign in to comment.