A friend of mine recently got into Rails development and asked me how I test-drive my Rails apps.
I replied with this screencast :)
In this screencast, we:
- create a new Rails 3 application
- include RSpec
- use Capybara to create integration specs
- make model specs to help pass our integration specs
- talk about testing stuff!
NOTE: I recorded this when Capybara hadn’t yet released support for RSpec’s spec/example metadata, allowing you to specify which driver you want to use (eg. selenium versus rack-test). I also couldn’t remember how to configure DatabaseCleaner. So this screencast is WAY long, as I try to figure out some new things …
I will record a shorter version of this screencast at some point, using all of the latest tools, so you can follow along and have your environment setup in tests running in 15 minutes or so.
But … if you want to see me get setup (and struggle to figure out why certain things blow up) … you can watch this :)