Merge pull request #4073 from solgenomics/topic/fix_another_type_id_issue
[sgn.git] / t / unit_mech / AJAX / DownloadPedigrees.t
blob39c300b9dfa253984c57d5121f661cb2e72aebc1
2 use strict;
3 use warnings;
5 use Test::More;
6 use Test::WWW::Mechanize;
7 use Data::Dumper;
8 use JSON;
9 local $Data::Dumper::Indent = 0;
11 # for identifying whitespace differences
12 # use String::Diff;
13 # use String::Diff qw( diff_fully diff diff_merge diff_regexp );# export functions
15 my $mech = Test::WWW::Mechanize->new;
17 $mech->get_ok("http://localhost:3010/breeders/download_pedigree_action?input_format=accession_ids&ped_format=parents_only&ids=38873,38874,38875,38876,38877");
18 my $response = $mech->content;
20 my $expected_response = 'Accession      Female_Parent   Male_Parent     Cross_Type
21 test5P001       test_accession4 test_accession5 
22 test5P002       test_accession4 test_accession5 
23 test5P003       test_accession4 test_accession5 
24 test5P004       test_accession4 test_accession5 
25 test5P005       test_accession4 test_accession5 
28 # for identifying whitespace differences
29 # my($old, $new) = String::Diff::diff($expected_response, $response);
30 # print STDERR "expected: $old\n";
31 # print STDERR "got: $new\n";
33 is($response, $expected_response, 'download direct parents pedigree');
35 $mech->get_ok('http://localhost:3010/breeders/download_pedigree_action?input_format=accession_ids&ped_format=full&ids=38873,38874,38875,38876,38877');
36 $response = $mech->content;
38 $expected_response = 'Accession Female_Parent   Male_Parent     Cross_Type
39 test5P001       test_accession4 test_accession5 
40 test5P002       test_accession4 test_accession5 
41 test5P003       test_accession4 test_accession5 
42 test5P004       test_accession4 test_accession5 
43 test5P005       test_accession4 test_accession5 
44 test_accession4 test_accession1 test_accession2 biparental
45 test_accession5 test_accession3         open
46 test_accession1                 
47 test_accession2                 
48 test_accession3                 
51 # for identifying whitespace differences
52 # ($old, $new) = String::Diff::diff($expected_response, $response);
53 # print STDERR "expected: $old\n";
54 # print STDERR "got: $new\n";
56 is($response, $expected_response, 'download full pedigree');
58 done_testing();