Merge branch 'topic/image_upload'
[sgn.git] / t / integration / feature_gene.t
blob42262f44baae79e7d8f6e964ade68ac691e67adc
1 =head1 NAME
3 t/integration/feature_gene.t - integration tests for gene feature URLs
5 =head1 DESCRIPTION
7 Tests for gene feature URLs
9 =head1 AUTHORS
11 Jonathan "Duke" Leto
13 =cut
15 use strict;
16 use warnings;
17 use Test::More;
18 use lib 't/lib';
19 use SGN::Test::Data qw/ create_test /;
20 use SGN::Test::WWW::Mechanize;
22 my $mech = SGN::Test::WWW::Mechanize->new;
24 my $gene_cvterm     = create_test('Cv::Cvterm', { name  => 'gene' });
25 my $gene_feature    = create_test('Sequence::Feature', { type => $gene_cvterm });
26 my $gene_featureloc = create_test('Sequence::Featureloc', { feature => $gene_feature });
28 $mech->get_ok("/feature/view/name/" . $gene_feature->name);
29 $mech->content_contains('Gene Data');
30 $mech->content_contains('Gene: ' . $gene_feature->name);
31 $mech->content_contains('Genomic Sequence');
32 $mech->content_contains('Related Features');
34 my ($name, $residues) = ($gene_feature->name, $gene_feature->residues);
36 like( $mech->findvalue( '/html/body//span[@class="sequence"]'), qr/>$name\s*$residues/, "Found >$name\\n$residues");
38 ok($mech->exists(
39         sprintf '/html/body//div[@class="info_table_fieldval"]/a[@href="/chado/cvterm.pl?cvterm_id=%s"]',
40             $gene_cvterm->cvterm_id
41     ),'the proper cvterm id link exists');
43 done_testing;