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

Refactor test suite for robustness #468

Open
chrisma opened this issue Mar 12, 2019 · 0 comments
Open

Refactor test suite for robustness #468

chrisma opened this issue Mar 12, 2019 · 0 comments

Comments

@chrisma
Copy link
Contributor

chrisma commented Mar 12, 2019

In the entire test suite:

  • When testing for the presence or absence of links or buttons, detect whether a page has an appropriate HTML tag with a given href attribute pointing to a named route, e.g. dashboard_path, rather than relying on brittle class names or link texts. Example: 458/450/RefactorVMPages #458 (comment)

  • When visiting or checking for paths, use named routes instead of strings, e.g. new_request_path vs. vms/requests/new

  • Rely on central test data storage in factories. If new versions of objects are needed, create a new factory and give it a descriptive name. If only attributes of objects are needed, use attributes_for() https://github.com/thoughtbot/factory_bot/blob/master/GETTING_STARTED.md#using-factories
    Example: e55e616

@chrisma chrisma changed the title Rely on hrefs for testing of links instead of link texts or classes Refactor test suite for robustness Mar 21, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant