Skip to content
New issue

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

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

Already on GitHub? # to your account

[#217] Emphasize that GET is the default method for cy.route #877

Merged
merged 2 commits into from
Aug 29, 2018
Merged

[#217] Emphasize that GET is the default method for cy.route #877

merged 2 commits into from
Aug 29, 2018

Conversation

richdouglasevans
Copy link
Contributor

closes #217

screen shot 2018-08-29 at 11 04 04

screen shot 2018-08-29 at 11 03 50

Match the route to a specific method (`GET`, `POST`, `PUT`, etc). If no method is defined, Cypress will match `GET` requests by default.
Match the route to a specific method (`GET`, `POST`, `PUT`, etc).

{% note bolt %}
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

😆 I just learned about bolt yesterday... using it plenty now 😄

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, it's a newer addition to notes, but pretty useful here.

{% note bolt %}
`GET` is the default HTTP method used to match routes. If you want to stub a route with another HTTP method such as `POST` then you {% urlHash 'must be explicit about the method' Arguments %}.
{% endnote %}

If a request doesn't match any route, {% urlHash "it will automatically receive a 404" Notes %}. For example, given we have the following routes:
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Well... darn 😢

Only just spotted this line about "automatically [receiving] a 404"... I'd better go back and amend my earlier PR #876

@jennifer-shehane jennifer-shehane self-requested a review August 29, 2018 15:30
@jennifer-shehane jennifer-shehane merged commit e36074d into cypress-io:develop Aug 29, 2018
@richdouglasevans richdouglasevans deleted the issue/217-emphasize-route-get branch August 29, 2018 16:46
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Emphasize default method for cy.route() is GET
2 participants