Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Anthony Parsons
committed
Oct 27, 2012
1 parent
bdf4db6
commit a1159fa
Showing
2 changed files
with
18 additions
and
2 deletions.
There are no files selected for viewing
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
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
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -0,0 +1,16 @@ | |||
use Test; | |||
use Bailador; | |||
use Bailador::Test; | |||
|
|||
plan 3; | |||
|
|||
post '/foo' => sub { request.env<psgi.input>.decode }; | |||
|
|||
my $data = 'hello=world&a=1;b=2'; | |||
my $req = Bailador::Request.new_for_request('POST', '/foo'); | |||
$req.env<psgi.input> = $postdata.encode('utf-8'); | |||
my $resp = Bailador::dispatch_request($req); | |||
|
|||
lives_ok { eager $req.params<hello> }, 'Request data parses without dying'; | |||
is ~$resp.content, $data, 'POST data string roundtrips correctly'; | |||
is $req.params<a>, '1;b=2', 'application/x-www-form-urlencoded POST data should only split on &'; |