CatalystX-Declare
view release on metacpan or search on metacpan
t/051_modifier_signatures.t view on Meta::CPAN
#!/usr/bin/env perl
use strict;
use warnings;
use FindBin;
use lib "$FindBin::Bin/lib";
use Test::More;
use Catalyst::Test 'TestApp';
is get('/modsig/foo/2/3'), 'modifiersignatures/foo modified', 'intended arguments work';
is get('/modsig/foo/2'), 'Page Not Found', 'missing argument leads to 404';
is get('/modsig/foo/2/3/4'), 'Page Not Found', 'one argument too many leads to 404';
is get('/modsig/foo/a/b'), 'Page Not Found', 'invalid arguments lead to bad request';
done_testing;
t/lib/TestApp/Controller/ModifierSignatures.pm view on Meta::CPAN
use CatalystX::Declare;
controller TestApp::Controller::ModifierSignatures
with TestApp::ControllerRole::ModifierSignatures {
action base as 'modsig' under '/';
final action foo (Int $x, Int $y) under base {
$ctx->response->body( $ctx->action->reverse );
}
final action not_found (@) under base as '' {
$ctx->response->body( 'Page Not Found' );
}
}
( run in 0.666 second using v1.01-cache-2.11-cpan-71847e10f99 )