convert to Distar
[catagits/Catalyst-Runtime.git] / t / evil_stash.t
CommitLineData
be57189a 1use warnings;
2use strict;
3use 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;
16
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
30use HTTP::Request::Common;
31use Catalyst::Test 'MyApp';
32
33{
34 ok my $res = request POST 'root/';
35}
36
37done_testing();