Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update Routing.pod #933

Merged
merged 1 commit into from Mar 10, 2016
Merged

Update Routing.pod #933

merged 1 commit into from Mar 10, 2016

Conversation

bfaist
Copy link
Contributor

@bfaist bfaist commented Mar 10, 2016

$t->post_ok('/blackjack')->status_code(200);

The current "under" example in this guide, does not specify a specific status code. So a test like this passes even though the "under" function failed which was not expected (could just be me). I realize I could test the content of the failure but seems useful to check the status codes as well.

I thought it might be useful to show how the failure of the "under" function could be used to return a different status code.

$t->get_ok('/blackjack')->status_code(401);
$t->get_ok('/blackjack' => { 'X-Bender' => 1 })->status_code(200);

$t->post_ok('/blackjack')->status_code(200);

The current "under" example in this guide, does not specify a specific status code.  So a test like this passes even though the "under" function failed which was not expected (could just be me).  I realize I could test the content of the failure but seems useful to check the status codes as well.

I thought it might be useful to show how the failure of the "under" function could be used to return a different status code.  

$t->get_ok('/blackjack')->status_code(401);
$t->get_ok('/blackjack' => { 'X-Bender' => 1 })->status_code(200);
@jhthorsen
Copy link
Member

LGTM 👍

jberger added a commit that referenced this pull request Mar 10, 2016
@jberger jberger merged commit dd66d84 into mojolicious:master Mar 10, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants