5 use Test::More tests => 1;
6 use HTTP::Request::Common;
9 package TestApp::Controller::Root;
10 $INC{'TestApp/Controller/Root.pm'} = __FILE__;
12 use MooseX::MethodAttributes;
13 extends 'Catalyst::Controller';
15 has counter => (is => 'rw', isa => 'Int', default => sub { 0 });
18 $self->counter($self->counter + 1);
20 sub root :Chained('/') :PathPart('') :CaptureArgs(0) {
21 my ($self, $c, $arg) = @_;
24 sub main :Chained('root') :PathPart('') :Args(0) {
25 my ($self, $c, $arg) = @_;
29 sub hits :Path('hits') :Args(0) {
30 my ($self, $c, $arg) = @_;
31 $c->response->body($self->counter);
33 __PACKAGE__->config(namespace => '');
37 $INC{'TestApp.pm'} = __FILE__;
39 __PACKAGE__->config(abort_chain_on_error_fix => 0);
43 use Catalyst::Test 'TestApp';
46 my $res = request('/');
49 my $res = request('/hits');
50 is $res->content, 1, "main action performed on crash with explicit setting to false";