summaryrefslogtreecommitdiffstats
path: root/t/content.t
blob: aa39a1e40461b2c122227ffa6215995b8c70da7a (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
#!/usr/bin/env perl
use strict;
use warnings;
use Test::More;
use Plack::Test;

use Web::Request;

my $app = sub {
    my $req = Web::Request->new_from_env(shift);
    is $req->content, 'body';
    $req->new_response(status => 200)->finalize;
};

test_psgi $app, sub {
    my $cb = shift;

    my $req = HTTP::Request->new(POST => "/");
    $req->content("body");
    $req->content_type('text/plain');
    $req->content_length(4);
    $cb->($req);
};

done_testing;