From Testing Rails book...
FEATURE/ACCEPTANCE:
- Check the happy paths
- Expensive so use sparingly
REQUEST:
- These are like feature tests, they go through router, render content, etc. More expensive than Controller specs.
CONTROLLER
- good to check 'Sad Paths'
- you can assert against an actual response object, but not check content rendered
VIEW & HELPER:
- Test a little piece of logic you have. Cheaper than feature spec, etc.
MODEL:
Useful Gems:
- email-spec (https://github.com/email-spec/email-spec)
- shoulda-matchers (https://github.com/thoughtbot/shoulda-matchers) for validation testing on models
Posted by Greg to Ruby on Rails (2017-07-06 13:12)