X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=trunk%2Ft%2Faggregate%2Funit_controller_actions.t;fp=trunk%2Ft%2Faggregate%2Funit_controller_actions.t;h=26e603d6fd1b593b58d6a022a22a78e5d824fa99;hb=e28a6876ad3e11890226e5bab6df4b0725e0981e;hp=0000000000000000000000000000000000000000;hpb=21c94d83082b43028cafcfb18659090b13d832fa;p=catagits%2FCatalyst-Runtime.git diff --git a/trunk/t/aggregate/unit_controller_actions.t b/trunk/t/aggregate/unit_controller_actions.t new file mode 100644 index 0000000..26e603d --- /dev/null +++ b/trunk/t/aggregate/unit_controller_actions.t @@ -0,0 +1,26 @@ +use strict; +use warnings; +use Test::More tests => 4; + +use Catalyst (); +{ + package TestController; + use Moose; + BEGIN { extends 'Catalyst::Controller' } + + sub action : Local {} + + sub foo : Path {} + + no Moose; +} + +my $mock_app = Class::MOP::Class->create_anon_class( superclasses => ['Catalyst'] ); +my $app = $mock_app->name->new; +my $controller = TestController->new($app, {actions => { foo => { Path => '/some/path' }}}); + +ok $controller->can('_controller_actions'); +is_deeply $controller->_controller_actions => { foo => { Path => '/some/path' }}; +is_deeply $controller->{actions} => { foo => { Path => '/some/path' }}; # Back compat. +is_deeply [ sort grep { ! /^_/ } map { $_->name } $controller->get_action_methods ], [sort qw/action foo/]; +