RailsCasts Pro episodes are now free!

Learn more or hide this

Applied Filters: test 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)
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)
Testing JavaScript with Jasmine (revised)
Episode #261Jun 28, 201266 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 #275Jul 18, 2011137 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 #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)
Testing Time & Web Requests
Episode #276Jul 25, 201150 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 #103Nov 12, 201295 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 #261Apr 11, 201144 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 #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)
Testing Exceptions
Episode #187Nov 09, 200955 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)