Commit | Line | Data |
be57189a |
1 | use warnings; |
2 | use strict; |
3 | use Test::More; |
4 | |
5 | { |
6 | package MyApp::Controller::Root; |
7 | $INC{'MyApp/Controller/Root.pm'} = __FILE__; |
8 | |
9 | use base 'Catalyst::Controller'; |
10 | |
11 | sub root :Path('') Args(0) { |
12 | my ($self, $c) = @_; |
13 | $c->{stash}->{foo} = 'bar'; |
14 | $c->stash(baz=>'boor'); |
15 | $c->{stash}->{baz} = $c->stash->{baz} . 2; |
88e5a8b0 |
16 | |
be57189a |
17 | Test::More::is($c->stash->{foo}, 'bar'); |
18 | Test::More::is($c->stash->{baz}, 'boor2'); |
19 | Test::More::is($c->{stash}->{foo}, 'bar'); |
20 | Test::More::is($c->{stash}->{baz}, 'boor2'); |
21 | |
22 | $c->res->body('return'); |
23 | } |
24 | |
25 | package MyApp; |
26 | use Catalyst; |
27 | MyApp->setup; |
28 | } |
29 | |
30 | use HTTP::Request::Common; |
31 | use Catalyst::Test 'MyApp'; |
32 | |
33 | { |
34 | ok my $res = request POST 'root/'; |
35 | } |
36 | |
37 | done_testing(); |