The London Perl and Raku Workshop takes place on 26th Oct 2024. If your company depends on Perl, please consider sponsoring and/or attending.
use strict;
use warnings;
use Test::More;
[% IF long_type == 'Controller' %][% IF mech %]

unless (eval q{use Test::WWW::Mechanize::Catalyst '[% name %]'; 1}) {
    plan skip_all => 'Test::WWW::Mechanize::Catalyst required';
    exit 0;
}

ok( my $mech = Test::WWW::Mechanize::Catalyst->new, 'Created mech object' );

$mech->get_ok( 'http://localhost[% uri %]' );
[%- ELSE %]

use Catalyst::Test '[% app %]';
use [% class %];

ok( request('[% uri %]')->is_success, 'Request should succeed' );
[%- END -%]
[% ELSE %]use Test::More;

BEGIN { use_ok '[% class %]' }
[% END -%]

done_testing();