Created
February 26, 2015 11:45
-
-
Save rpcme/16e712d9effbcf0593b9 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /usr/bin/env perl | |
use Mojolicious::Lite; | |
use Test::More; | |
use Test::Mojo; | |
post '/' => sub { | |
my $self = shift; | |
my $ct = $self->req->upload('bin')->headers->content_type; | |
my $out = defined $ct ? $ct : "ct undef"; | |
$self->render(text => $out); | |
}; | |
my $t = Test::Mojo->new; | |
$t->post_ok( '/' => form => { bin => { file => 'foo.ear' } } ) | |
->status_is(200) | |
->content_like(qr/ct undef/); | |
done_testing(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment