Amon2
view release on metacpan or search on metacpan
share/flavor/Large/t/07_mech_links.t view on Meta::CPAN
push @links, $token->[1]->{ $link_tags{ $token->[0] } };
}
return grep { m{^/} } @links;
}
for my $psgi (glob('script/*-server')) {
subtest $psgi => sub {
my $app = Plack::Util::load_psgi($psgi);
my $mech = Test::WWW::Mechanize::PSGI->new( app => $app );
$mech->credentials( 'admin', 'admin' );
$mech->get_ok('/');
my @links = _extract_links($mech);
for (@links) {
$mech->get('/');
$mech->get_ok($_);
}
};
}
t/300_setup/06_large.t view on Meta::CPAN
};
subtest 'admin' => sub {
my $app = Plack::Util::load_psgi("script/my-app-admin-server");
my $mech = Test::WWW::Mechanize::PSGI->new(app => $app);
{
my $res = $mech->get('http://localhost/');
is($res->code, 401);
}
{
$mech->credentials('admin', 'admin');
my $res = $mech->get('http://localhost/');
is($res->code, 200);
};
};
like(slurp('tmpl/web/include/layout.tx'), qr{jquery}, 'loads jquery');
}, 'Large');
done_testing;
t/300_setup/09_minil_migrate.t view on Meta::CPAN
],
};
...
note slurp("$libdir/bin/${script}");
test_tcp(
client => sub {
my $port = shift;
my $ua = LWP::UserAgent->new();
$ua->credentials( "127.0.0.1:${port}", 'restricted area', 'admin', 'admin');
my $res = $ua->get("http://127.0.0.1:${port}/");
is($res->code, 200);
},
server => sub {
my $port = shift;
exec $^X, "-Mlib=$libdir/lib/perl5/", '--', "$libdir/bin/${script}", '-p', $port, '-c', $conf;
die;
},
);
};
( run in 0.263 second using v1.01-cache-2.11-cpan-4d50c553e7e )