Tests for the modules with a keep_stash option
[catagits/Catalyst-View-Component-SubInclude.git] / t / lib / KeepStash / Controller / Root.pm
diff --git a/t/lib/KeepStash/Controller/Root.pm b/t/lib/KeepStash/Controller/Root.pm
new file mode 100644 (file)
index 0000000..c911af3
--- /dev/null
@@ -0,0 +1,29 @@
+package KeepStash::Controller::Root;
+
+use strict;
+use warnings;
+use base 'Catalyst::Controller';
+
+__PACKAGE__->config->{namespace} = '';
+
+sub subrequest_keepstash_index : Path('subrequest_keepstash_index') :Args(0) {
+    my ($self, $c) = @_;
+    $c->stash->{'stash_value'} = 5;
+    $c->stash->{'deep'}->{'stash_value'} = 9;
+}
+
+sub visit_keepstash_index : Path('visit_keepstash_index') :Args(0) {
+    my ($self, $c) = @_;
+    $c->stash->{'stash_value'} = 5;
+    $c->stash->{'deep'}->{'stash_value'} = 9;
+}
+
+sub keepstash_call : Path('keepstash_call') :Args(0) {
+    my ($self, $c) = @_;
+    $c->stash->{'stash_value'}++;
+    $c->stash->{'deep'}->{'stash_value'}++;
+}
+
+sub end : ActionClass('RenderView') {}
+
+1;