File tree Expand file tree Collapse file tree 2 files changed +5
-10
lines changed
lib/MetaCPAN/Web/Controller Expand file tree Collapse file tree 2 files changed +5
-10
lines changed Original file line number Diff line number Diff line change @@ -57,16 +57,17 @@ sub index : Path {
5757
5858 if ( $results -> {total } == 1 ) {
5959 my $module_name
60- = $results -> {results }-> [0]-> [0]-> {module }-> [0]-> {names };
60+ = $results -> {results }-> [0]-> [0]-> {module }-> [0]-> {name };
6161 $c -> res-> redirect(" /pod/$module_name " );
6262 $c -> detach;
6363 }
6464 elsif ( !$results -> {total } && !$authors -> {total } ) {
65- if ( $query =~ m / :/ ) {
66- $query =~ s / :+(?)/ ::/ g if ( $query !~ m / (\w )(\b )::(\w )(\b )/ );
65+ my $suggest = $query ;
66+ $suggest =~ s / :+/ ::/ g ;
67+ if ( $suggest ne $query ) {
6768 $c -> stash(
6869 {
69- suggest => $query ,
70+ suggest => $suggest ,
7071 }
7172 );
7273 }
Original file line number Diff line number Diff line change @@ -12,14 +12,8 @@ my %tests = (
1212test_psgi app, sub {
1313 my $cb = shift ;
1414 while ( my ( $k , $v ) = each %tests ) {
15-
1615 ok( my $res = $cb -> ( GET " /search?q=$k " ), ' search for ' . $k );
1716 my $tx = tx($res );
18- use Data::Dump qw/ dump/ ;
19- warn dump (
20- $tx -> find_value(
21- ' //div[@class="no-results"]//div[@class="alert alert-error"]' )
22- );
2317 my $module
2418 = $tx -> find_value(
2519 ' //div[@class="no-results"]//div[@class="alert alert-error"]//a[1]'
You can’t perform that action at this time.
0 commit comments