File: live_component_controller_anon.t

package info (click to toggle)
libcatalyst-perl 5.90132-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 3,016 kB
  • sloc: perl: 11,061; makefile: 7
file content (24 lines) | stat: -rw-r--r-- 911 bytes parent folder | download | duplicates (8)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
use strict;
use warnings;

use FindBin;
use lib "$FindBin::Bin/../lib";

use Test::More tests => 6;
use Catalyst::Test 'TestApp';

{
    my $response = request('http://localhost/anon/test');
    ok($response->is_success);
    is($response->header('X-Component-Name-Action'),
        'TestApp::Controller::Anon', 'Action can see correct catalyst_component_name');
    isnt($response->header('X-Component-Instance-Name-Action'),
        'TestApp::Controller::Anon', 'ref($controller) ne catalyst_component_name');
    is($response->header('X-Component-Name-Controller'),
        'TestApp::Controller::Anon', 'Controller can see correct catalyst_component_name');
    is($response->header('X-Class-In-Action'),
        'TestApp::Controller::Anon', '$action->class is catalyst_component_name');
    is($response->header('X-Anon-Trait-Applied'),
        '1', 'Anon controller class has trait applied correctly');
}