Skip to content

Instantly share code, notes, and snippets.

@kianaditya
Created May 9, 2019 07:01
Show Gist options
  • Save kianaditya/f471201a3991e2aa63dea8b58298ee19 to your computer and use it in GitHub Desktop.
Save kianaditya/f471201a3991e2aa63dea8b58298ee19 to your computer and use it in GitHub Desktop.
beforeEach(() => {
cy.server();
cy.route({
method: "GET",
url: "http://localhost:3000/sessions?page=1",
response: "fixture:sessionpage_1.json"
});
cy.route({
method: "GET",
url: "http://localhost:3000/sessions?page=2",
response: "fixture:sessionpage_2.json"
});
cy.route({
method: "POST",
status: "200",
url: "http://localhost:3000/sessions",
response: "fixture:create_session.json"
});
cy.route({
method: "POST",
status: "200",
url: "http://localhost:3000/sessions/91/rsvps",
response: "fixture:book_session.json"
});
cy.route({
method: "DELETE",
url: "http://localhost:3000/auth/sign_out",
response: "fixture:logout.json"
});
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment