File: live_component_controller_moose.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 (36 lines) | stat: -rw-r--r-- 1,286 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
use strict;
use warnings;

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

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

{
    my $response = request('http://localhost/moose/get_attribute');
    ok($response->is_success);
    is($response->content, '42', 'attribute default values get set correctly');
}

{
    my $response = request('http://localhost/moose/methodmodifiers/get_attribute');
    ok($response->is_success);
    is($response->content, '42', 'parent controller method called');
    is($response->header('X-Catalyst-Test-After'), 'after called', 'after works as expected');
}

{
    my $response = request('http://localhost/moose/with_local_modifier');
    ok($response->is_success);
    is($response->content, '42', 'attribute default values get set correctly');
    is($response->header('X-Catalyst-Test-Before'), 'before called', 'before works as expected');
}
{
    my $response = request('http://localhost/moose/methodmodifiers/with_local_modifier');
    ok($response->is_success);
    is($response->content, '42', 'attribute default values get set correctly');
    is($response->header('X-Catalyst-Test-After'), 'after called', 'after works as expected');
    is($response->header('X-Catalyst-Test-Before'), 'before called', 'before works as expected');
}