โ Ruby on Rails learning pathRuby on Rails ยท Module 10 of 10
Testing and deploying Rails
Ship a tested Rails app to production.
๐ Key ideas
- Rails includes Minitest; many teams use RSpec.
- Model, request and system tests cover different layers.
- Fixtures or FactoryBot create test data.
- Rails 8 uses Kamal to deploy containers to any server.
- Run bin/rails assets:precompile and migrations during deploy; watch logs after.
๐ก Real-life example: Like a final rehearsal before the annual day: tests rehearse every scene, and deploy is opening night.
System testBrowser-driven end-to-end test
FactoryBotBuilds test records
KamalRails 8 container deploy tool
Request testTests a controller over HTTP