X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?p=catagits%2FCatalyst-Runtime.git;a=blobdiff_plain;f=t%2Flib%2FTestApp%2FController%2FAttributes.pm;h=6cb536ccb71e9d01ac2866ad01f4deac0768a021;hp=6f8020bdd37ea0fd60a0ee342a8b29d165d02ec7;hb=0b0aee670c39f8cb8f140eb62de9bfaf2c343a24;hpb=683d672bda70d0e1297bb8e4695df2b370f8b9a3 diff --git a/t/lib/TestApp/Controller/Attributes.pm b/t/lib/TestApp/Controller/Attributes.pm index 6f8020b..6cb536c 100644 --- a/t/lib/TestApp/Controller/Attributes.pm +++ b/t/lib/TestApp/Controller/Attributes.pm @@ -4,27 +4,38 @@ use warnings; package My::AttributesBaseClass; use base qw( Catalyst::Controller ); -sub fetch : Chained('/') PathPrefix CaptureArgs(1) { +sub fetch : Chained('/') PathPrefix CaptureArgs(0) { } -} +sub left_alone :Chained('fetch') PathPart Args(0) { } -sub view : PathPart Chained('fetch') Args(0) { +sub view : PathPart Chained('fetch') Args(0) { } -} +sub foo { } # no attributes -sub foo { # no attributes +package TestApp::Controller::Attributes; +use base qw(My::AttributesBaseClass); +sub _parse_MakeMeVisible_attr { + my ($self, $c, $name, $value) = @_; + if (!$value){ + return Chained => 'fetch', PathPart => 'all_attrs', Args => 0; + } + elsif ($value eq 'some'){ + return Chained => 'fetch', Args => 0; + } + elsif ($value eq 'one'){ + return PathPart => 'one_attr'; + } } -package TestApp::Controller::Attributes; -use base qw(My::AttributesBaseClass); +sub view { } # override attributes to "hide" url -sub view { # override attributes to "hide" url +sub foo : Local { } -} +sub all_attrs_action :MakeMeVisible { } -sub foo : Local { +sub some_attrs_action :MakeMeVisible('some') PathPart('some_attrs') { } -} +sub one_attr_action :MakeMeVisible('one') Chained('fetch') Args(0) { } 1;