Commit | Line | Data |
fc7ec1d9 |
1 | package TestApp; |
2 | |
e05c5e3c |
3 | use Catalyst qw[-Engine=Test]; |
fc7ec1d9 |
4 | |
5 | __PACKAGE__->action( |
6 | foo => sub { |
7 | my ( $self, $c ) = @_; |
8 | $c->stash->{test} ||= 'foo'; |
9 | $c->forward('bar'); |
10 | }, |
11 | bar => sub { |
12 | my ( $self, $c ) = @_; |
13 | $c->stash->{test} ||= 'bar'; |
14 | $c->forward('yada'); |
15 | }, |
16 | yada => sub { |
17 | my ( $self, $c ) = @_; |
18 | $c->stash->{test} ||= 'yada'; |
19 | $c->res->output( $c->stash->{test} ); |
20 | } |
21 | ); |
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/ ); |