Merge pull request #4073 from solgenomics/topic/fix_another_type_id_issue
[sgn.git] / t / unit_mech / AJAX / Search / Trait.t
blob438519076aa50432819b005473d93a20c36641b6
1 use strict;
2 use warnings;
4 use lib 't/lib';
5 use SGN::Test::Fixture;
6 use Test::More;
7 use Test::WWW::Mechanize;
9 use Data::Dumper;
10 use JSON;
11 local $Data::Dumper::Indent = 0;
13 my $f = SGN::Test::Fixture->new();
14 my $schema = $f->bcs_schema;
16 my $mech = Test::WWW::Mechanize->new;
17 my $response;
19 $mech->post_ok('http://localhost:3010/ajax/search/traits?length=5&start=1' );
20 $response = decode_json $mech->content;
21 print STDERR Dumper $response;
23 is_deeply($response, {'data' => [['','<a href="/cvterm/70761/view">CO_334:0000121</a>','<a href="/cvterm/70761/view">amylopectin content ug/g in percentage</a>','Estimation of amylopectin content of cassava roots in percentage(%).','<em>None</em>','amylopectin content ug/g in percentage','CO_334:0000121'],['','<a href="/cvterm/70752/view">CO_334:0000124</a>','<a href="/cvterm/70752/view">amylose amylopectin root content ratio</a>','The amylose content of a cassava root sample divided by the amylopectin content of the same sample.','<em>None</em>','amylose amylopectin root content ratio','CO_334:0000124'],['','<a href="/cvterm/70676/view">CO_334:0000075</a>','<a href="/cvterm/70676/view">amylose content in ug/g percentage</a>','Estimation of amylose content of cassava roots in percentage (%).','<em>None</em>','amylose content in ug/g percentage','CO_334:0000075'],['','<a href="/cvterm/70717/view">CO_334:0000061</a>','<a href="/cvterm/70717/view">anther color</a>','Visual scoring of anther color with 1 = cream, 2 = yellow, and 3 = other.','<em>None</em>','anther color','CO_334:0000061'],['','<a href="/cvterm/70775/view">CO_334:0000103</a>','<a href="/cvterm/70775/view">anthocyanin pigmentation visual rating 0-3</a>','Visual rating of distribution of anthocyanin pigmentation with 0 = absent, 1 = top part, 2 = central part, 3 = totally pigmented.','<em>None</em>','anthocyanin pigmentation visual rating 0-3','CO_334:0000103']],'recordsTotal' => 257,'recordsFiltered' => 257,'draw' => undef}, 'trait ajax search');
26 done_testing();