add tests which prove the current behavior of not decoding chained args but decoding...
[catagits/Catalyst-Runtime.git] / t / lib / TestApp / Controller / Action / Chained.pm
index 90b1efe..c3c85fe 100644 (file)
@@ -15,7 +15,11 @@ sub begin :Private { }
 #
 #   Simple parent/child action test
 #
-sub foo  :PathPart('chained/foo')  :CaptureArgs(1) :Chained('/') { }
+sub foo  :PathPart('chained/foo')  :CaptureArgs(1) :Chained('/') {
+    my ( $self, $c, @args ) = @_;
+    die "missing argument" unless @args;
+    die "more than 1 argument" if @args > 1;
+}
 sub endpoint  :PathPart('end')  :Chained('/action/chained/foo')  :Args(1) { }
 
 #
@@ -185,6 +189,14 @@ sub wurst       : Chained('apan')  CaptureArgs(1) PathPart('') { }
 sub static_end  : Chained('korv')  Args(0)                     { }
 sub capture_end : Chained('wurst') Args(0)        PathPart('') { }
 
+
+# */search vs doc/*
+sub view : Chained('/') PathPart('chained') CaptureArgs(1) {}
+sub star_search : Chained('view') PathPart('search') Args(0) { }
+sub doc_star : Chained('/') PathPart('chained/doc') Args(1) {}
+
+sub return_arg : Chained('/') PathPart('chained/return_arg') Args(1) {}
+
 sub end :Private {
   my ($self, $c) = @_;
   return if $c->stash->{no_end};