How to test for a redirect in Mojolicious?
Set the matching setting from Mojo::UserAgent:
$t->ua->max_redirects(10)
Also, you don't need to build the form post manually:
$t->post_form_ok('/items/new/submit' => $data)->status_is(...);
Reference:
- http://mojolicio.us/perldoc/Test/Mojo#ua
- http://mojolicio.us/perldoc/Mojo/UserAgent#max_redirects
- http://mojolicio.us/perldoc/Test/Mojo#post_form_ok