From 4e33aea1025e8db370cfaaa4b3142c965edd0fbc Mon Sep 17 00:00:00 2001 From: "Jonathan \"Duke\" Leto" Date: Tue, 27 Sep 2011 18:12:55 -0700 Subject: [PATCH] Make bulk gene tests less noisy and closer to passing --- lib/SGN/Controller/Bulk.pm | 7 ++++--- t/integration/bulk_gene.t | 9 ++++----- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/lib/SGN/Controller/Bulk.pm b/lib/SGN/Controller/Bulk.pm index b242e794c..7892c26ae 100644 --- a/lib/SGN/Controller/Bulk.pm +++ b/lib/SGN/Controller/Bulk.pm @@ -184,10 +184,8 @@ sub bulk_gene_submit :Path('/bulk/gene/submit') :Args(0) { $c->log->debug("Found " . scalar(@mrnas) . " mrna seq ids"); $success++ if @mrnas; - # depending on form values, push different data my @seqs = (map { mrna_cds_protein_sequence($_) } @mrnas ); - my $type_index = { cdna => 0, cds => 1, @@ -198,7 +196,10 @@ sub bulk_gene_submit :Path('/bulk/gene/submit') :Args(0) { my $index = $type_index->{$type}; unless ($index) { - $c->throw_client_error(public_message => 'Invalid data type'); + $c->throw_client_error( + public_message => 'Invalid data type', + http_status => 200, + ); } my $o = $_->[$index]; diff --git a/t/integration/bulk_gene.t b/t/integration/bulk_gene.t index 18103d6dd..379f73e57 100644 --- a/t/integration/bulk_gene.t +++ b/t/integration/bulk_gene.t @@ -44,7 +44,7 @@ $mech->with_test_level( local => sub { gene_type => '', }, }, "submit bulk_gene with a single valid identifier but invalid gene_type"); - $mech->content_like(qr/Invalid data type chosen/) or diag $mech->content; + $mech->content_like(qr/Invalid data type chosen/); }); $mech->with_test_level( local => sub { @@ -56,7 +56,7 @@ $mech->with_test_level( local => sub { gene_type => 'not_valid', }, }, "submit bulk_gene with a single valid identifier"); - $mech->content_like(qr/Invalid data type chosen/) or diag $mech->content; + $mech->content_like(qr/Invalid data type chosen/); }); $mech->with_test_level( local => sub { $mech->get('/bulk/gene'); @@ -72,7 +72,6 @@ $mech->with_test_level( local => sub { $mech->content_unlike(qr/Your query did not contain any valid identifiers/); }); - $mech->with_test_level( local => sub { $mech->get('/bulk/gene'); $mech->submit_form_ok({ @@ -84,7 +83,7 @@ $mech->with_test_level( local => sub { }, "submit bulk_gene with a single valid identifier for cdna"); my $sha1 = sha1_hex("cdna Solyc02g081670.1"); $mech->content_unlike(qr/Caught exception/) or diag $mech->content; - $mech->content_unlike(qr/Your query did not contain any valid identifiers/) or diag $mech->content; + $mech->content_unlike(qr/Your query did not contain any valid identifiers/); my @flinks = $mech->find_all_links( url_regex => qr{/bulk/gene/download/$sha1\.fasta} ); cmp_ok(@flinks, '==', 1, "found one FASTA download link for $sha1.fasta"); $mech->links_ok( \@flinks ); @@ -138,7 +137,7 @@ $mech->with_test_level( local => sub { }, "submit bulk_gene with a single valid identifier for protein"); my $sha1 = sha1_hex("protein Solyc02g081670.1"); $mech->content_unlike(qr/Caught exception/) or diag $mech->content; - $mech->content_unlike(qr/Your query did not contain any valid identifiers/) or diag $mech->content; + $mech->content_unlike(qr/Your query did not contain any valid identifiers/); my @flinks = $mech->find_all_links( url_regex => qr{/bulk/gene/download/$sha1\.fasta} ); cmp_ok(@flinks, '==', 1, "found one FASTA download link for $sha1.fasta"); $mech->links_ok( \@flinks ); -- 2.11.4.GIT