File tree 2 files changed +5
-10
lines changed
lib/MetaCPAN/Web/Controller
2 files changed +5
-10
lines changed Original file line number Diff line number Diff line change @@ -57,16 +57,17 @@ sub index : Path {
57
57
58
58
if ( $results -> {total } == 1 ) {
59
59
my $module_name
60
- = $results -> {results }-> [0]-> [0]-> {module }-> [0]-> {names };
60
+ = $results -> {results }-> [0]-> [0]-> {module }-> [0]-> {name };
61
61
$c -> res-> redirect(" /pod/$module_name " );
62
62
$c -> detach;
63
63
}
64
64
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 ) {
67
68
$c -> stash(
68
69
{
69
- suggest => $query ,
70
+ suggest => $suggest ,
70
71
}
71
72
);
72
73
}
Original file line number Diff line number Diff line change @@ -12,14 +12,8 @@ my %tests = (
12
12
test_psgi app, sub {
13
13
my $cb = shift ;
14
14
while ( my ( $k , $v ) = each %tests ) {
15
-
16
15
ok( my $res = $cb -> ( GET " /search?q=$k " ), ' search for ' . $k );
17
16
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
- );
23
17
my $module
24
18
= $tx -> find_value(
25
19
' //div[@class="no-results"]//div[@class="alert alert-error"]//a[1]'
You can’t perform that action at this time.
0 commit comments