Secrets of Testing Rails 5 apps
summary
Rails 5 gives concrete testing changes: a new Test Runner invoked via bin/rails test (powered by Minitest 5 plugins) that prints runnable failing lines, supports -f and -b, and enables colored output; generated controller tests use ActionDispatch::IntegrationTest by default (assign/assert_template deprecated and extractable to rails-controller-testing); API tests get request encoders (as: :json) and response parsing via parsed_body; Active Job uses the async adapter in test, test order is randomized, and new helpers like file_fixture reduce boilerplate.
AI-written summary · about
chapters (43)
- 0:00SECRETS OF TESTING RAILS 5 APPS
- 0:21BIGBinary
- 2:19the way we test code
- 2:31the way we run tests
- 3:01Recap
- 3:56Limitations
- 5:22Test Runner
- 5:40bin/rails test
- 6:21Rerun snippets
- 7:00Documentation
- 7:53Running multiple tests
- 9:38Fail fast
- 10:05Colored output
- 10:29Minitest 5
- 11:15Inspirations
- 14:45Integration tests are slow
- 15:43Close to real world
- 16:30Rails 5 generates integration controller tests
- 16:44Old apps?
- 16:58Backward compatible
- 17:27Action Controller::Test Case gem
- 17:53Implications
- 22:10status code
- 22:28can't test instance variables
- 22:40can't test which template rendered
- 23:35test actual HTML
- 24:11Not just testing controller action
- 24:25Controller + View
- 25:08There is a space between controller and views
- 25:39Controller View interface
- 26:35Why do we test controller internals
- 28:00Interface testing
- 28:26Testing controllers the old way
- 30:03Controller via engine
- 31:10Testing API apps
- 32:43Request Encoding
- 35:41Active Job Async adapter
- 36:49Random test ordering
- 41:05Request methods
- 41:19Better experience
- 41:43Happy testing!
- 42:00With Rails default test stack
- 42:18Rails 5 Blog Series Rails%205
related talks
31mSecrets of Testing Rails 5 Apps
37mSecrets of Testing Rails 5 Apps
33mRuby on Rails on Minitest
36mBuilding the Rails ActionDispatch::SystemTestCase framework
40mBuilding Rails ActionDispatch::SystemTestCase Framework
31mQuick and easy browser testing using RSpec and Rails 5.1
28mTeaching RSpec to Play nice with Rails
32mA Big Look at MiniTest
