File: basic_rest.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 (27 lines) | stat: -rw-r--r-- 569 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
use strict;
use warnings;
use Test::More;

BEGIN {
    if (!eval {require Catalyst::Action::REST; Catalyst::Action::REST->VERSION(0.74)}) {
        plan skip_all => 'This test needs Catalyst::Action::REST >=0.74';
    }

    plan tests => 3;
}

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

use Catalyst::Test 'TestAppREST';

my %roles = (
    foo  => 'TestAppREST::ActionRole::Moo',
);

while (my ($path, $role) = each %roles) {
    my $resp = request("/foo/${path}");
    ok($resp->is_success);
    is($resp->content, $role);
    is($resp->header('X-Affe'), 'Tiger');
}