File: execution-via-does.t

package info (click to toggle)
libcatalyst-controller-actionrole-perl 0.17-2
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, bullseye, forky, sid, trixie
  • size: 376 kB
  • sloc: perl: 488; makefile: 2
file content (31 lines) | stat: -rw-r--r-- 659 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
use strict;
use warnings;
use Test::More tests => 6;

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

use Catalyst::Test 'TestApp';

my %actions = (
    one  => [qw(
        TestApp::ActionRole::First
    )],
    two  => [qw(
        TestApp::ActionRole::First
        TestApp::ActionRole::Second
    )]
);

while (my ($path, $roles) = each %actions) {
    my $resp = request("/executionviadoes/${path}");
    ok($resp->is_success,
        "request to /$path is succesful"
    );
    is($resp->content, join(',', sort @$roles),
        "all roles applied"
    );
    is($resp->header('X-Executed-Times'), scalar @$roles,
        "...and called once only"
    );
}