RSpec Best Practices - thuy-econsys/rails_app GitHub Wiki
let
instead of instance variables and before blocks
Use - Use let and let! | Better Specs - Testing Guidelines for Developers
- When to use RSpec let()?
- RSpec: What is the difference between let and a before block?
Break up large example blocks into smaller tests
preferably single expectations in order to narrow down where your tests are failing
Use factories instead of fixtures
- Use factories and not fixtures | Better Specs - Testing Guidelines for Developers
- Rails Testing Antipatterns: Fixtures and Factories - Semaphore