RailsCasts Pro episodes are now free!

Learn more or hide this

Applied Filters: testing 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)
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)
Testing JavaScript with Jasmine (revised)
Episode #261 – Jun 28, 2012 – 66 comments

Testing JavaScript with Jasmine (revised)

The jasminerice gem makes it easy to test your JavaScript with Jasmine in a Rails application. Here I also cover jasmine-jquery and guard-jasmine. (11 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)
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)
Testing Time & Web Requests
Episode #276 – Jul 25, 2011 – 50 comments

Testing Time & Web Requests

It can be difficult to test code that deals with the current time or an external web request. Here I show you how to do both using the Timecop and FakeWeb gems. (8 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 Jasmine
Episode #261 – Apr 11, 2011 – 44 comments

Testing JavaScript with Jasmine

Are you testing your JavaScript? Learn how to add specs using Jasmine. This episode also covers jQuery integration with jasmine-jquery. (15 minutes)
MiniTest with Rails
Episode #327 – Feb 21, 2012 – 77 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)
Testing Exceptions
Episode #187 – Nov 09, 2009 – 55 comments

Testing Exceptions

Sometimes bad code slips into production and triggers a 500 error. Learn how to be notified of this and resolve it through integration tests. (10 minutes)