Skip to content

Instantly share code, notes, and snippets.

@lmiller1990
Created September 28, 2018 04:00
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save lmiller1990/197dd1feda55495078c63981f15eb0f1 to your computer and use it in GitHub Desktop.
Save lmiller1990/197dd1feda55495078c63981f15eb0f1 to your computer and use it in GitHub Desktop.
const context = describe
describe('Creates a post', () => {
context('the post is valid', () => {
it('redirects to the created post', () => {
cy.visit('localhost:3000/posts/new')
cy.get('#post_title').type('my post', {force: true})
cy.get('#post_body').type('this is the post body', {force: true})
cy.get('#post_category_id').select('ruby', {force: true})
cy.get('input[type="submit"]').click()
cy.get('.category').contains('Category: ruby')
})
})
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment