spelling fixes and more docs
[catagits/Catalyst-Runtime.git] / t / data_handler.t
CommitLineData
e2aa4a21 1#!/usr/bin/env perl
2
3use warnings;
4use strict;
5
6use FindBin;
7use Test::More;
8use HTTP::Request::Common;
9use JSON::MaybeXS;
10
11use lib "$FindBin::Bin/lib";
12use Catalyst::Test 'TestDataHandlers';
13
14ok my($res, $c) = ctx_request('/');
15ok my $message = 'helloworld';
16ok my $post = encode_json +{message=>$message};
17ok my $req = POST $c->uri_for_action('/test_json'),
18 Content_Type => 'application/json',
19 Content => $post;
20
21ok my $response = request $req, 'got a response from a catalyst controller';
22is $response->content, $message, 'expected content body';
23
24done_testing;