From 0f790f3709914b3b032c31cf606fa45730e8a20b Mon Sep 17 00:00:00 2001 From: "Jonathan \"Duke\" Leto" Date: Tue, 7 Jun 2011 13:37:24 -0700 Subject: [PATCH] Fix a bug with search controller args and add lots of tests --- lib/SGN/Controller/Search.pm | 4 ++-- t/SGN/Controller/Search.t | 20 ++++++++++++++++++-- 2 files changed, 20 insertions(+), 4 deletions(-) diff --git a/lib/SGN/Controller/Search.pm b/lib/SGN/Controller/Search.pm index 777ba4418..0ddc98703 100644 --- a/lib/SGN/Controller/Search.pm +++ b/lib/SGN/Controller/Search.pm @@ -16,7 +16,7 @@ BEGIN {extends 'Catalyst::Controller'; } my @tabs = ( ['/search/loci','Genes'], - ['/search/phenotype_qtl_trait','QTLs & Phenotypes'], + ['/search/qtl','QTLs & Phenotypes'], ['/search/unigene','Unigenes'], ['/search/family', 'Unigene Families' ], ['/search/markers','Markers'], @@ -77,7 +77,7 @@ Search. =cut -sub search :Path('/search/') :Args(1) { +sub search :Path('/search/') :Args() { my ( $self, $c, $term, @args ) = @_; $c->stash->{term} = $term; diff --git a/t/SGN/Controller/Search.t b/t/SGN/Controller/Search.t index f438189ac..7fc56877d 100644 --- a/t/SGN/Controller/Search.t +++ b/t/SGN/Controller/Search.t @@ -3,9 +3,25 @@ use lib 't/lib'; use SGN::Test; use Test::Most; - BEGIN { use_ok 'Catalyst::Test', 'SGN' } BEGIN { use_ok 'SGN::Controller::Search' } -ok( request('/search/')->is_success, 'Request should succeed' ); +my @urls = qw{ + /search + /search/ + /search/loci + /search/qtl + /search/unigene + /search/family + /search/markers + /search/bacs + /search/est_library + /search/images + /search/directory + /search/template_experiment_platform +}; + +for my $url (@urls) { + ok( request($url)->is_success, "GET $url succeeded"); +} done_testing(); -- 2.11.4.GIT