Recently I’ve been playing with some tests on an old Rails Project. In terms of actual Computer Science Mesure Units or CSMUs, this is quite old (remember that one CSMU is the time used by a user to change his/hers iPhone 🙂
Some failures on the test forced me to look up for some solutions and Capybara-screenshot was one of the elected ones, instead of being playing around with messages on the log file. The sad side of recent versions of this gem is that it seemed not to play well with Rails 2.3 infrastructure. There is a Rails 2.3 compatible version but some of the usual methods of Capybara-screenshot were not working well.
What I have founded is this recipe running for me: install capybara-screenshot 0.3.14, then require it on your spec_helper.rb file. When your test fails the screenshot is not being automatically taken (at least in my case), but you can use it manually, before the offending line by putting «screenshot_and_open_image» 🙂
Cheers.