RailsCasts Pro episodes are now free!

Learn more or hide this

Applied Filters: rspec xTesting x
Fast Tests
Episode #413 – Apr 10, 2013 – 200 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)
How I Test
Episode #275 – Jul 18, 2011 – 137 comments

How I Test

Here I show how I would add tests to the password reset feature created in the previous episode. I use RSpec, Capybara, Factory Girl, and Guard to make request, model, and mailer specs. (15 minutes)
RSpec Matchers & Macros
Episode #157 – Apr 13, 2009 – 40 comments

RSpec Matchers & Macros

You can improve the readability and remove duplication in RSpec by adding matchers and macros. Learn how in this episode. (18 minutes)
Extracting a Ruby Gem
Episode #301 – Nov 21, 2011 – 40 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)
Site-Wide Announcements (revised)
Episode #103 – Nov 12, 2012 – 95 comments

Site-Wide Announcements (revised)

Here I show how to add an announcement message at the top of every page in the application and allow the user to permanently hide it. This is all done test-first and even includes testing the JavaScript behavior. (11 minutes)
Testing JavaScript with PhantomJS
Episode #391 – Nov 07, 2012 – 84 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)
Request Specs and Capybara
Episode #257 – Mar 14, 2011 – 54 comments

Request Specs and Capybara

Request specs in RSpec are a great way to ensure the entire application stack is working properly. Here I also show how to use capybara with integrated JavaScript testing using Selenium. (13 minutes)
Testing with VCR
Episode #291 – Oct 17, 2011 – 53 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)
Spork
Episode #285 – Sep 26, 2011 – 76 comments

Spork

Spork improves the loading time of your test suite by starting up your Rails application once in the background. Use it with Guard for the ultimate combo in fast feedback while doing TDD. (9 minutes)
Guard
Episode #264 – May 02, 2011 – 57 comments

Guard

Guard watches files and runs a command after a file is modified. This allows you to automatically run tests in the background, restart your development server, reload the browser, and more. (8 minutes)