Skip to content

Commit 0324c6e

Browse files
author
oiami
committed
Remove debug msg and add test of redirection to the module of 1 result
1 parent 35100b1 commit 0324c6e

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

t/controller/search.t

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,12 +20,16 @@ test_psgi app, sub {
2020

2121
ok( $res = $cb->( GET "/search?q=moose\">" ), 'GET /search?q=moose">' );
2222
is( $res->code, 200, 'code 200' );
23-
24-
use Data::Dump qw/dump/;
25-
warn dump( $res->content );
2623
ok( $res->content =~ /Task::Kensho/,
2724
'get recommendation about Task::Kensho on No result page' );
2825

26+
ok( $res = $cb->( GET "/search?q=ctx_request" ),
27+
'GET /search?q=ctx_request' );
28+
is( $res->code, 302,
29+
'code 302 get redirected to the module if there is 1 result' );
30+
is( $res->headers->{location},
31+
'/pod/Catalyst::Test', 'get new location to module page' );
32+
2933
ok( $res = $cb->( GET "/search?q=moose" ), 'GET /search?q=moose' );
3034
is( $res->code, 200, 'code 200' );
3135

0 commit comments

Comments
 (0)