FactoryBot Vs. Fixtures: Testing Rails Applications
Compare FactoryBot vs fixtures for Rails test data. Learn how each works, build vs create, performance, and when to choose each.
Jean Emmanuel is a Full-Stack Software Engineer specializing in Ruby on Rails and the modern Rails ecosystem. He builds scalable, maintainable web applications using Rails, Hotwire (Turbo & Stimulus), PostgreSQL, and SQLite, with a focus on fast, dynamic user experiences. Through CodeCurious, he shares practical lessons, development insights, and real-world solutions for modern developers.
Compare FactoryBot vs fixtures for Rails test data. Learn how each works, build vs create, performance, and when to choose each.
Learn how Rails system tests use Capybara and Selenium to verify real user workflows, handle JavaScript, and debug flaky tests.
Learn how browser caching works, how to set Cache-Control, ETag, and 304 responses, and how to configure it in Rails 8.1 apps.
Learn how to build accessible forms with semantic HTML, ARIA, validation, focus management, and Rails form_with examples.
Learn how ETags, Last-Modified, and conditional GET requests work, and use Rails stale? and fresh_when to return 304 responses.
Learn Rails rate limiting with rate_limit, cache stores, and Redis to protect logins, APIs, and forms from abuse.
Build custom Rails generators with templates, arguments, options, and tests to automate boilerplate and enforce conventions.
Learn how Propshaft serves, fingerprints, and delivers Rails assets, how it differs from Sprockets, and how to deploy it safely.
Learn how to read SQL EXPLAIN output in PostgreSQL and MySQL, spot slow scans and bad joins, and tune queries with evidence.
Learn how optimistic and pessimistic locking work in Rails, when to use each, and how to prevent lost updates safely.