Commit | Line | Data |
2167982f |
1 | use strict; |
2 | use warnings; |
3 | |
4 | use FindBin; |
5 | use lib "$FindBin::Bin/../lib"; |
6 | |
84848664 |
7 | use Test::More tests => 12; |
2167982f |
8 | use Catalyst::Test 'TestApp'; |
9 | |
10 | { |
11 | my $response = request('http://localhost/moose/get_attribute'); |
12 | ok($response->is_success); |
13 | is($response->content, '42', 'attribute default values get set correctly'); |
14 | } |
87e41a18 |
15 | |
16 | { |
84848664 |
17 | my $response = request('http://localhost/moose/methodmodifiers/get_attribute'); |
18 | ok($response->is_success); |
19 | is($response->content, '42', 'parent controller method called'); |
20 | is($response->header('X-Catalyst-Test-After'), 'after called', 'after works as expected'); |
21 | } |
22 | |
23 | { |
24 | my $response = request('http://localhost/moose/with_local_modifier'); |
25 | ok($response->is_success); |
26 | is($response->content, '42', 'attribute default values get set correctly'); |
27 | is($response->header('X-Catalyst-Test-Before'), 'before called', 'before works as expected'); |
28 | } |
29 | { |
30 | my $response = request('http://localhost/moose/methodmodifiers/with_local_modifier'); |
31 | ok($response->is_success); |
32 | is($response->content, '42', 'attribute default values get set correctly'); |
33 | is($response->header('X-Catalyst-Test-After'), 'after called', 'after works as expected'); |
34 | is($response->header('X-Catalyst-Test-Before'), 'before called', 'before works as expected'); |
87e41a18 |
35 | } |
84848664 |
36 | |