BDD on Rails with Minitest, Part 1: Up and Running
Blog post from Semaphore
Chris Kottom, a Ruby and Rails developer, introduces a behavior-driven development (BDD) workflow using Minitest, an alternative to RSpec and Cucumber, for creating test-driven applications in Ruby on Rails. The blog post details the setup of a testing stack with Minitest, Capybara, and supporting gems to create a simple Rails application for managing a to-do list. Kottom walks through implementing the red-green-refactor cycle, demonstrating how to write tests that fail initially due to missing components, then guiding the development to pass these tests by incrementally building the application features. The article highlights Minitest's flexibility with both assert-style and spec-style syntax, advocating for the latter due to its similarity to RSpec's approach, and emphasizes using tests as a feedback mechanism in the development process.