Avoiding Sneaky Testing Antipatterns
summary
Practical rules for tightening Rails test suites: prefer positive assertions like expect(user.save).to be true instead of negations, force a failing test by stashing a bug fix before writing the test, avoid broad RSpec let usage and keep setup inline to preserve cause and effect, and never add production code paths gated by test mode — use gem helpers such as Clearance’s test helpers and FactoryBot for fixtures. Goal: expressive, isolated, reliable tests that actually catch regressions.
AI-written summary · about
related talks
31mGoing on a Testing Anti-Pattern Safari
29mCommon Mistakes that make test cases flaky and how to avoid them
20mApplying RSpec Best Practices
29m"Testing. Why so serious?"
44mHow to Stop Hating your Test Suite
46mBetter code through boring(er) tests
34mBetter Code Through Boring(er) Tests
01h 00mTesting Heresies
