Created
June 23, 2011 16:06
-
-
Save monken/1042865 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
use strict; | |
use warnings; | |
use Test::More; | |
use MetaCPAN::Test; | |
test_psgi app, sub { | |
my $cb = shift; | |
ok( my $res = $cb->( GET "/author/DOESNTEXIST" ), | |
'GET /author/DOESNTEXIST' ); | |
is( $res->code, 404, 'code 404' ); | |
ok( $res = $cb->( GET "/author/PERLER" ), 'GET /author/PERLER' ); | |
is( $res->code, 200, 'code 200' ); | |
my $tx = tx($res); | |
$tx->like( '/html/head/title', qr/PERLER/, 'title includes author name' ); | |
my $release = $tx->_findv( | |
'//table//tbody/tr[1]/td[1]//a/@href'); | |
ok( $release, 'found a release' ); | |
ok( $res = $cb->( GET $release), "GET $release" ); | |
is( $res->code, 200, 'code 200' ); | |
}; | |
done_testing; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment