Applying RSpec Best Practices
summary
Explains concrete RSpec practices: model specs use describe/subject/context with a Game of Life example, prefer unit tests over integration, avoid testing Rails internals, and treat specs as executable documentation. Recommends three RSpec settings: color, profile, documentation (profile shows the 10 slowest examples). Uses let for shared collaborators, favors the must vs should assertion style (mentions the mustard plugin), and emphasizes tests that enforce SOLID and Law of Demeter.
AI-written summary · about
chapters (6)
- 0:00Principles of testing
- 2:47Structuring RSpec tests
- 5:18Assertive testing practices
- 7:46Configuration and tooling
- 9:38Advanced TDD strategies
- 12:52Questions and answers
related talks
20mMake it SPECtacular
06mAvoiding Sneaky Testing Antipatterns
04mLightning Talk DRYing up RSpec
01h 04mClean RSpec: A Workshop on Ruby Testing Craftsmanship
50mWriting Solid Ruby Code
42mWorkshop / Taming Chaotic Specs: RSpec Design Patterns
27mUnderstanding Rails test types in RSpec
28mTeaching RSpec to Play nice with Rails
