D:D has fixed the method invocation issue now
[catagits/CatalystX-Declare.git] / t / lib / TestApp / Controller / Foo.pm
index 1b0313d..453581d 100644 (file)
@@ -136,6 +136,17 @@ controller TestApp::Controller::Foo with TestApp::TestRole {
                 action stream is final {
                     $ctx->response->body($ctx->action->reverse);
                 }
+
+                action param (Int $x) { 
+                    $ctx->stash(param_x => $x);
+                }
+
+                under param {
+
+                    final action road (Int $y) {
+                        $ctx->response->body($ctx->stash->{param_x} + $y);
+                    }
+                }
             }
         }
     }
@@ -228,5 +239,15 @@ controller TestApp::Controller::Foo with TestApp::TestRole {
     final action inline_class under base {
         $ctx->response->body( TestApp::Controller::Foo::Messenger->new(message => 'Hello')->format );
     }
+
+
+    #
+    #   validation test
+    #
+
+    final action wants_integer (Int $x) under base {
+        $ctx->response->body($x);
+    }
+
 }