3 use Test::More tests => 1;
4 use HTTP::Request::Common;
7 package TestApp::Controller::Root;
8 $INC{'TestApp/Controller/Root.pm'} = __FILE__;
10 use MooseX::MethodAttributes;
11 extends 'Catalyst::Controller';
13 has counter => (is => 'rw', isa => 'Int', default => sub { 0 });
16 $self->counter($self->counter + 1);
18 sub root :Chained('/') :PathPart('') :CaptureArgs(0) {
19 my ($self, $c, $arg) = @_;
22 sub main :Chained('root') :PathPart('') :Args(0) {
23 my ($self, $c, $arg) = @_;
27 sub hits :Path('hits') :Args(0) {
28 my ($self, $c, $arg) = @_;
29 $c->response->body($self->counter);
31 __PACKAGE__->config(namespace => '');
35 $INC{'TestApp.pm'} = __FILE__;
37 __PACKAGE__->config(abort_chain_on_error_fix => 1);
38 __PACKAGE__->setup('-Log=fatal');
41 use Catalyst::Test 'TestApp';
44 my $res = request('/');
47 my $res = request('/hits');
48 is $res->content, 0, "main action not touched on crash with explicit setting to true";