💎 Ruby on Rails
Intermediate
What is Rails testing (RSpec vs Minitest)?
Answer
Rails ships with Minitest as the default testing framework, offering unit tests, functional tests, integration tests, and system tests. It uses a simple assertion-based API. RSpec is a popular alternative BDD framework with a more expressive DSL (describe, context, it, expect, should matchers). The Rails testing stack includes: FactoryBot (fixtures alternative for creating test data), Faker (fake data generation), Shoulda-Matchers (model validation matchers for RSpec), and Capybara (browser simulation for integration/system tests).
Previous
What is the difference between update_all and update in Rails?
Next
What is database indexing and why is it important in Rails?