Commit | Line | Data |
5bb1a415 |
1 | use strict; |
2 | use warnings; |
3 | |
4 | use FindBin; |
5 | use lib "$FindBin::Bin/../lib"; |
6 | |
7 | use Test::More tests => 6; |
8 | use Catalyst::Test 'TestApp'; |
9 | |
10 | { |
11 | my $response = request('http://localhost/anon/test'); |
12 | ok($response->is_success); |
13 | is($response->header('X-Component-Name-Action'), |
14 | 'TestApp::Controller::Anon', 'Action can see correct _component_name'); |
15 | isnt($response->header('X-Component-Instance-Name-Action'), |
16 | 'TestApp::Controller::Anon', 'ref($controller) ne _component_name'); |
17 | is($response->header('X-Component-Name-Controller'), |
18 | 'TestApp::Controller::Anon', 'Controller can see correct _component_name'); |
19 | is($response->header('X-Class-In-Action'), |
20 | 'TestApp::Controller::Anon', '$action->class is _component_name'); |
21 | is($response->header('X-Anon-Trait-Applied'), |
22 | '1', 'Anon controller class has trait applied correctly'); |
23 | } |
24 | |