Secrets of Testing Rails 5 Apps
summary
Rails 5 replaces rake test with bin/rails test, shipping a Minitest-based test runner and custom reporter that adds colored output, fail‑fast, rerun‑failed, run‑by‑line and deferred output without extra gems. Controller specs now default to integration tests, which the talk claims run as fast as functional tests, so middleware, session and headers must be set via real requests and keyword args (params:, session:, headers:). assigns/assert_template are deprecated, API-only helpers auto-set JSON headers, and tests run in random order by default.
AI-written summary · about
chapters (26)
- 0:00Intro
- 2:52Secrets of Testing Rails 5 apps
- 3:09Delete tests
- 4:46Running tests without batteries
- 7:09Writing tests
- 7:20Unit tests Functional tests Integration tests
- 7:55What do we test in a controller test
- 9:19Controller tests are easy
- 9:47Controller tests actually lie
- 11:31Almost same as controller test
- 12:41Integration controller tests are default in Rails 5
- 13:00Functional controller tests are soft deprecated
- 13:50Implications
- 16:27Black Box
- 16:48What not to test in integration style controller tests?
- 17:01Don't test controller internals
- 19:22Not just testing controller action in isolation
- 19:48Controller View interface
- 21:29Testing controller isolated from views
- 22:10HTTP Request methods
- 22:43Positional arguments
- 23:56Keyword arguments
- 25:24Testing API requests
- 27:22Active Job Async adapter
- 28:15Random test ordering
- 29:13Test Runner








