Alex Duterte

Oct 12, 2020

3 min read

Test Driven Development in Ruby on Rails using Rspec

Test Driven Development (aka TDD) is where you create test specs of expected outcomes. You can then code your way to pass these tests. The opposite of this method of coding is Behavioral Driven Development (BDD).

Setting up

First thing we need to do is install the ‘rspec-rails’ gem. We want this in the development test section in our gem file.