Dancer-Plugin-REST
view release on metacpan or search on metacpan
t/two-posts.t view on Meta::CPAN
plan skip_all => 'tests require JSON'
unless Dancer::ModuleLoader->load('JSON');
plan tests => 2;
use Dancer::Test;
use HTTP::Headers;
my $head = HTTP::Headers->new;
$head->header("content-type" => "application/json");
for ( 1..2 ) {
my $resp = dancer_response( 'POST' => '/foo.json', {
body => '{"yin":"yang","foo":"bar"}',
headers => $head,
});
like $resp->content, qr/yin/;
}
( run in 1.088 second using v1.01-cache-2.11-cpan-d7f47b0818f )