Skip to content

Commit

Permalink
added another Mojo::UserAgent::Transactor test
Browse files Browse the repository at this point in the history
  • Loading branch information
kraih committed Apr 3, 2012
1 parent 4690065 commit 1371e13
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion t/mojo/transactor.t
@@ -1,6 +1,6 @@
use Mojo::Base -strict;

use Test::More tests => 197;
use Test::More tests => 201;

# "Once the government approves something, it's no longer immoral!"
use File::Spec::Functions 'catdir';
Expand Down Expand Up @@ -51,6 +51,14 @@ is $tx->req->headers->content_type, 'application/x-www-form-urlencoded',
'right "Content-Type" value';
is $tx->req->body, 'test=123', 'right content';

# Simple form with multiple values
$tx = $t->form('http://kraih.com/foo' => {test => [1, 2, 3]});
is $tx->req->url->to_abs, 'http://kraih.com/foo', 'right URL';
is $tx->req->method, 'POST', 'right method';
is $tx->req->headers->content_type, 'application/x-www-form-urlencoded',
'right "Content-Type" value';
is $tx->req->body, 'test=1&test=2&test=3', 'right content';

# UTF-8 form
$tx = $t->form('http://kraih.com/foo', 'UTF-8', {test => 123});
is $tx->req->url->to_abs, 'http://kraih.com/foo', 'right URL';
Expand Down

0 comments on commit 1371e13

Please sign in to comment.