You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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
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-factoriesExample: e55e616
The text was updated successfully, but these errors were encountered: