RailsCasts Pro episodes are now free!

Learn more or hide this

Applied Filters: rspec 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)
Upgrading to Rails 4
Episode #415May 06, 2013211 comments

Upgrading to Rails 4

With the release of Rails 4.0.0.rc1 it's time to try it out and report any bugs. Here I walk you through the steps to upgrade a Rails 3.2 application to Rails 4. (12 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)
Custom App Generators (revised)
Episode #148Feb 03, 2013100 comments

Custom App Generators (revised)

Learn how to customize the Rails app generator to fit your preference. This episode shows how to do this using .railsrc file, app templates, app builders, RailsWizard, and AppScrolls. (10 minutes)
RSpec Matchers & Macros
Episode #157Apr 13, 200940 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 #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)
Presenters from Scratch
Episode #287Oct 03, 2011122 comments

Presenters from Scratch

Clean up complex view logic with the help of presenters, and doing this from scratch gives you a lot of flexibility. Here I show not only how to create presenters, but how to test them using Test Unit and RSpec. (14 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)
Authorization from Scratch Part 2
Episode #386Oct 11, 201297 comments

Authorization from Scratch Part 2

This finishes the series on building authorization from scratch by refactoring the permission logic into a DSL, restricting authorization with attributes, and combining with strong_parameters to protect params. (20 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)