Merge branch 'master' into topic/simple_image_upload
[sgn.git] / t / unit_mech / Controller / QuickSearch.t
blob9020410d08d1b3a2439b955540be7e2f879491ed
1 use strict;
2 use warnings;
4 use Test::More;
6 use lib 't/lib';
8 use Test::WWW::Mechanize;
10 my $mech = Test::WWW::Mechanize->new();
12 print STDERR "Fetching URL...\n";
13 $mech->get_ok('http://localhost:3010/search/quick?term=test_accession1', 'check accession quicksearch');
15 print STDERR "Checking content...\n";
16 $mech->content_contains('0 EST identifiers');
17 $mech->content_contains('1 accession');
19 $mech->get_ok('http://localhost:3010/search/quick?term=TestPopulation1', 'check population quicksearch');
20 $mech->content_contains('1 population', 'check if population found.');
22 $mech->get_ok('http://localhost:3010/search/quick?term=Kasese+solgs+trial', 'check trial quicksearch');
23 $mech->content_contains('0 EST identifiers', 'should not find ESTs');
24 $mech->content_contains('0 accession', 'should not find accessions');
25 $mech->content_contains('1 trial', 'check if trial found');
27 $mech->get_ok('http://localhost:3010/search/quick?term=root+yield', 'check trait quicksearch');
28 $mech->content_contains('1 trait', 'check if trait found');
30 $mech->get_ok('http://localhost:3010/search/quick?term=Cornell+biotech', 'check locations quicksearch');
31 $mech->content_contains('1 location', 'check if location found');
33 $mech->get_ok('http://localhost:3010/search/quick?term=test', 'check breeding program quicksearch');
34 $mech->content_contains('1 breeding program');
36 done_testing;