Dear M Users: I am trying to have my tests follow my redirects. The
following snippet
my $t = Test::Mojo->new;
## $t->ua->max_redirects(100);
$t->get_ok('http://localhost:3000/')->status_is(200);
produces
ok 1 - GET http://localhost:3000/
not ok 2 - 200 OK
# Failed test '200 OK'
# at SylSpace.t line 10.
# got: '302'
# expected: '200'
1..2
which is what I want. Uncomment the max_redirects, and instead of
following, it dies on the get_ok
# Can't connect: nodename nor servname provided, or not known
not ok 1 - GET http://localhost:3000/
# Failed test 'GET http://localhost:3000/'
# at SylSpace.t line 10.
not ok 2 - 200 OK
# Failed test '200 OK'
# at SylSpace.t line 10.
# got: undef
# expected: '200'
1..2
# Looks like you failed 2 tests of 2.
I verified by hand on my chrome browser that it does end up in a good spot.
so how do I request a get, follow the redirect, perhaps test which url I
am arriving on, and then test the result?
advice appreciated.
regards,
/iaw
--
You received this message because you are subscribed to the Google Groups
"Mojolicious" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/mojolicious.
For more options, visit https://groups.google.com/d/optout.