Skip to content

Instantly share code, notes, and snippets.

@suchov
Created April 12, 2017 09:08
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 suchov/75e7d040dd1e170383c0288bfeda8433 to your computer and use it in GitHub Desktop.
Save suchov/75e7d040dd1e170383c0288bfeda8433 to your computer and use it in GitHub Desktop.
Move sad paths out of feature specs
Feature specs are slow. They have to boot up a fake browser and navigate around.
They’re particularly slow when using a JavaScript driver which incurs even more
overhead. While you do want a feature spec to cover every user facing feature of
your application, you also don’t want to duplicate coverage.
Many times, feature specs are written to cover both happy paths and sad paths. In
an attempt to mitigate duplicate code coverage with slower tests, we’ll often write
our happy path tests with feature specs, and sad paths with some other medium,
such as request specs or view specs. Finding a balance between too many and too
few feature specs comes with experience.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment