RailsCasts Pro episodes are now free!

Learn more or hide this

Applied Filters: Pro Episodes xTesting x
Fast Tests
Episode #413Apr 10, 2013200 comments

Fast Tests

A slow test suite can put a damper on test-driven development. In this episode I show a variety of ways to optimize specs including: selective testing, preloading Rails, and testing outside of Rails. (17 minutes)
A Tour of State Machines
Episode #392Nov 17, 201293 comments

A Tour of State Machines

Here I show how three popular state machine gems can be used to clean up a list of boolean/datetime fields. I also show a custom solution which keeps track of the history of events. (12 minutes)
Testing JavaScript with PhantomJS
Episode #391Nov 07, 201284 comments

Testing JavaScript with PhantomJS

PhantomJS allows us to test JavaScript without going through a browser window. Here I show how to do this using Capybara and Poltergeist. I also give some tips on handling database transactions and skipping javascript tests. (10 minutes)
MiniTest with Rails
Episode #327Feb 21, 201277 comments

MiniTest with Rails

MiniTest is a fast and lightweight testing library. Here you will learn how to use it in a Rails app for model, helper, and integration testing. The Turn gem is also demonstrated for prettier test output. (15 minutes)
Extracting a Ruby Gem
Episode #301Nov 21, 201140 comments

Extracting a Ruby Gem

In this episode I show how to extract a Ruby Gem from an existing Rails application, test it with RSpec and Supermodel, and add a Railtie. (16 minutes)
Testing with VCR
Episode #291Oct 17, 201153 comments

Testing with VCR

If you ever need to test an application which communicates with an external API, VCR is the way to go. Here I show a workflow in RSpec, how to use with capybara-mechanize, how to add sanitization filtering, and more. (13 minutes)