# This file documents the revision history for Perl extension Catalyst.
+5.90049_002 - 2013-08-20
+ - Fixed loading middleware from project directory
+ - Fixed some pointless warnings when middleware class lacked VERSION
+ - NEW FEATURE: Declare global 'data_handlers' for parsing HTTP POST/PUT
+ alternative content, and created default JSON handler. Yes, now Catalyst
+ handles JSON request content out of the box!
+
5.90049_001 - 2013-07-26
- Declare PSGI compliant Middleware as part of your Catalyst Application via
a new configuration key, "psgi_middleware".
test_requires 'HTTP::Request::Common';
test_requires 'IO::Scalar';
test_requires 'HTTP::Status';
+test_requires 'JSON::MaybeXS';
# aggregate tests if AGGREGATE_TESTS is set and a recent Test::Aggregate and a Test::Simple it works with is available
my @author_requires;
--- /dev/null
+#!/usr/bin/env perl
+
+use warnings;
+use strict;
+
+use FindBin;
+use Test::More;
+use HTTP::Request::Common;
+use JSON::MaybeXS;
+
+use lib "$FindBin::Bin/lib";
+use Catalyst::Test 'TestDataHandlers';
+
+ok my($res, $c) = ctx_request('/');
+ok my $message = 'helloworld';
+ok my $post = encode_json +{message=>$message};
+ok my $req = POST $c->uri_for_action('/test_json'),
+ Content_Type => 'application/json',
+ Content => $post;
+
+ok my $response = request $req, 'got a response from a catalyst controller';
+is $response->content, $message, 'expected content body';
+
+done_testing;
--- /dev/null
+package TestDataHandlers;
+
+use Catalyst;
+
+__PACKAGE__->config(
+ 'Controller::Root', { namespace => '' }
+);
+
+__PACKAGE__->setup;
--- /dev/null
+package TestDataHandlers::Controller::Root;
+
+use base 'Catalyst::Controller';
+
+sub test_json :Local {
+ my ($self, $c) = @_;
+ $c->res->body($c->req->body_data->{message});
+}
+
+1;