Merge pull request #5230 from solgenomics/topic/open_pollinated
[sgn.git] / t / legacy / integration / feature_search.t
blob3c2c71cde578ecf2126105565198f1f70b3353b8
1 =head1 NAME
3 t/integration/feature_search.t - integration tests for feature search URLs
5 =head1 DESCRIPTION
7 Tests for feature search URLs
9 =head1 AUTHORS
11 Jonathan "Duke" Leto
13 =cut
15 use strict;
16 use warnings;
17 use Test::More;
18 use Test::JSON;
19 use lib 't/lib';
20 use SGN::Test::WWW::Mechanize skip_cgi => 1;
22 my $mech = SGN::Test::WWW::Mechanize->new;
24 $mech->get_ok("/search/features");
25 $mech->content_like(qr/search/i);
26 $mech->content_contains('<script', 'yep, there is some javascript in there, hah');
27 $mech->html_lint_ok;
29 my @urls = qw(
31     /search/features/feature_types_service?page=1&start=0&limit=25
32     /search/features/featureprop_types_service?page=1&start=0&limit=25
33     /search/features/srcfeatures_service?page=1&start=0&limit=25
34     /search/features/search_service?page=1&start=0&limit=100&sort=feature_id&dir=ASC
35     /search/features/search_service?organism=lycoper&type_id=22627&srcfeature_id=&srcfeature_start=&srcfeature_end=&proptype_id=&page=1&start=0&limit=100&sort=feature_id&dir=ASC
36     /search/features/search_service?_dc=1321036511068&organism=lycoper&type_id=&srcfeature_id=&srcfeature_start=&srcfeature_end=&proptype_id=24269&prop_value=1&page=1&start=0&limit=100&sort=feature_id&dir=ASC
39 for my $url ( @urls ) {
40     $mech->get_ok( $url );
41     is_valid_json $mech->content;
44 $mech->get_ok('/search/features/export_csv?organism=lycop&type_id=22157&srcfeature_id=17638255&srcfeature_start=1&srcfeature_end=1000000');
46 done_testing;