fix decoded uploads
[catagits/Catalyst-Runtime.git] / t / abort-chain-3.t
CommitLineData
b914d353 1use strict;
2use warnings;
3use Test::More tests => 1;
4use HTTP::Request::Common;
5
6BEGIN {
7 package TestApp::Controller::Root;
8 $INC{'TestApp/Controller/Root.pm'} = __FILE__;
9 use Moose;
10 use MooseX::MethodAttributes;
11 extends 'Catalyst::Controller';
12
13 has counter => (is => 'rw', isa => 'Int', default => sub { 0 });
14 sub increment {
15 my $self = shift;
16 $self->counter($self->counter + 1);
17 }
18 sub root :Chained('/') :PathPart('') :CaptureArgs(0) {
19 my ($self, $c, $arg) = @_;
20 die "Died in root";
21 }
22 sub main :Chained('root') :PathPart('') :Args(0) {
23 my ($self, $c, $arg) = @_;
24 $self->increment;
25 die "Died in main";
26 }
27 sub hits :Path('hits') :Args(0) {
28 my ($self, $c, $arg) = @_;
29 $c->response->body($self->counter);
30 }
31 __PACKAGE__->config(namespace => '');
32}
33{
34 package TestApp;
35 $INC{'TestApp.pm'} = __FILE__;
36 use Catalyst;
37 __PACKAGE__->config(abort_chain_on_error_fix => 0);
53c7cc10 38 __PACKAGE__->setup('-Log=fatal');
b914d353 39}
40
41use Catalyst::Test 'TestApp';
42
43{
44 my $res = request('/');
45}
46{
47 my $res = request('/hits');
48 is $res->content, 1, "main action performed on crash with explicit setting to false";
49}