033c720bbb9966ab9f6b718cb712f3550b287d00
[catagits/Catalyst-Runtime.git] / t / 12stash.t
1 package TestApp;
2
3 use Catalyst qw[-Engine=Test];
4
5 sub foo : Global {
6     my ( $self, $c ) = @_;
7     $c->stash->{test} ||= 'foo';
8     $c->forward('bar');
9 }
10 sub bar : Global {
11         my ( $self, $c ) = @_;
12         $c->stash->{test} ||= 'bar';
13         $c->forward('yada');
14 }
15 sub yada : Global {
16         my ( $self, $c ) = @_;
17         $c->stash->{test} ||= 'yada';
18         $c->res->output( $c->stash->{test} );
19 }
20
21 __PACKAGE__->setup;
22
23 package main;
24
25 use Test::More tests => 2;
26 use Catalyst::Test 'TestApp';
27
28 ok( get('/foo') =~ /foo/ );
29 ok( get('/bar') =~ /bar/ );