Skip to main content

Testing for Ruby on Railss

Testing in Rails uses Minitest by default, with fixtures or factories for data, and several test types: model tests, controller or request tests, and system tests that drive a real browser through Capybara. Running them in continuous integration catches regressions before they reach production.

Stage: Quality and Deployment · Part of the Ruby on Rails roadmap · Last reviewed 19 November 2026

What to learn in Testing

Testing interview questions

What is the difference between a request test and a system test?

A request test sends HTTP requests directly to the app and checks status, redirects and response body, and is fast. A system test drives a real or headless browser, so it exercises JavaScript and full user flows, but runs slower.

What is the advantage of fixtures over factories?

Fixtures are YAML data loaded once into the database, so tests start quickly. Factories build records on demand and make each test's data explicit, which can be clearer but slower. Rails defaults to fixtures, and many teams choose FactoryBot.

Where Testing fits in the Ruby on Rails roadmap

Testing belongs to the Quality and Deployment stage (advanced level). Ship.

Back to the full Ruby on Rails roadmap