7 use SGN::Test::WWW::Mechanize skip_cgi => 1;
8 use SGN::Test::Data qw/create_test/;
10 # set up test gene groups
11 my $group = create_test('Sequence::Feature');
12 my @orgs = map create_test('Organism::Organism'), 0..2;
13 my $schema = $group->result_source->schema;
14 for ( [ $orgs[0], 4 ], [ $orgs[1], 2 ], [ $orgs[2], 5 ] ) {
15 my ( $org, $count ) = @$_;
17 my $gene = create_test('Sequence::Feature',{
18 type => $schema->get_cvterm_or_die('sequence:gene'),
21 add_relationship( $gene, 'sequence:member_of', $group );
23 my $mrna = create_test('Sequence::Feature', {
24 type => $schema->get_cvterm_or_die('sequence:mRNA'),
26 residues => 'CATCATCATCAT',
28 add_relationship( $mrna, 'relationship:part_of', $gene );
30 my $poly = create_test('Sequence::Feature', {
31 type => $schema->get_cvterm_or_die('sequence:polypeptide'),
33 residues => 'MMMMMMMMMMMMMM',
35 add_relationship( $poly, 'relationship:derives_from', $mrna );
39 my $mech = SGN::Test::WWW::Mechanize->new;
40 $mech->get_ok('/feature/'.$group->name.'/details');
41 $mech->get_ok('/feature/'.$group->name.'/gene_group_protein_fasta');
42 $mech->content_contains('>feature_');
43 $mech->content_contains('MMMMMMMMMM');
50 #####################################################
52 sub add_relationship {
53 my ( $subject, $relationship, $object ) = @_;
55 $subject->add_to_feature_relationship_subjects(
56 { type => $schema->get_cvterm_or_die( $relationship ),