route_exists checks for 200 return status? #499

Closed
szabgab opened this Issue Oct 24, 2013 · 4 comments

Projects

None yet

4 participants

@szabgab
Contributor
szabgab commented Oct 24, 2013

It seems that the route_exists test function expects the route to return 200
though from its name I was expecting it to accept also routes that are redirecting.
Specifically I have a route that redirects on some condition but route_exists fails with

Failed test 'a route handler is defined for /'

at t/002_index_route.t line 9.

got: '302'

expected: '200'

Owner
xsawyerx commented Dec 8, 2013

I'm sorry, I can't put this into context. Could you provide the route code so I understand what you're actually seeing?

Contributor
szabgab commented Dec 8, 2013

test:

route_exists [GET => '/jumper'], 'a route handler is defined for /jumper';
response_status_is ['GET' => '/jumper'], 302, 'response status is 302 for /jumper';

module:

get '/jumper' => sub {
    redirect '/';
};

result:

#   Failed test 'a route handler is defined for /jumper'
#   at t/002_index_route.t line 12.
#          got: '302'
#     expected: '200'
ok 4 - response status is 302 for /jumper

I would expect the the route_exists to succeed.

Owner
xsawyerx commented Dec 8, 2013

Oh, I see now.
Thanks!

@veryrusty veryrusty added the Bug label Mar 20, 2014
Contributor
mickeyn commented May 28, 2014

Closed by #533.

@mickeyn mickeyn closed this May 28, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment