Skip to content

Instantly share code, notes, and snippets.

@monken
Created June 23, 2011 16:06
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save monken/1042865 to your computer and use it in GitHub Desktop.
Save monken/1042865 to your computer and use it in GitHub Desktop.
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