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

Specs that make changes to the web page should reset the page to default settings #332

Closed
monfresh opened this issue Mar 10, 2014 · 2 comments
Labels

Comments

@monfresh
Copy link
Member

Specs are run in a random order, and should be independent of each spec's state. If a spec sets a filter value (like this one for example: https://github.com/codeforamerica/ohana-web-search/blob/master/spec/features/search/filters_spec.rb#L42-44), and that value is not reset, then another spec that doesn't expect that value will fail. The most common failure will be in the VCR request which will include an extra unexpected parameter in the API call.

All specs that make changes to the web page should run a reset method at the end of the spec to make sure each spec runs with a clean default state.

@anselmbradford
Copy link
Member

That would explain the VCR errors (most commits I have to refresh Travis once to get them to pass—only on Travis, not locally). But I thought background runs before each test and is the place to reset test states? https://github.com/codeforamerica/ohana-web-search/blob/master/spec/features/search/filters_spec.rb#L7 should visit the homepage without any parameters. How should I set up a reset method?

@monfresh
Copy link
Member Author

No longer an issue now that we have removed these specs with the simplification of the search fields.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants