8 use HTTP::Status ':constants';
11 $ENV{SGN_SKIP_CGI} = 1;
12 use_ok 'SGN::Test::WWW::Mechanize';
13 use_ok 'SGN::Controller::ITAG';
16 my $mech = SGN::Test::WWW::Mechanize->new;
19 $mech->get_ok( '/itag/list_releases' );
23 my $release_link = $mech->find_link( url_regex => qr!^/itag/release/\d! );
25 skip 'no ITAG release link found', 1 unless $release_link;
27 $mech->get_ok( $release_link->url, 'click on file listing for the first available ITAG release' );
29 my @all_links = $mech->find_all_links( url => '' );
31 skip 'no ITAG bulk file releases found, skipping remaining tests', 2 unless @all_links;
33 ok(@all_links, 'found some links on ' . $release_link->text);
35 diag(Dumper(@all_links));
37 my @file_links = grep $_->attrs->{onclick} =~ /show_download_form/, @all_links;
39 cmp_ok( @file_links, '>', 5, 'got at least 5 file links for itag release '. $release_link->text );