Capybara screenshot on ancient Rails 2.3.X projects

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.

Acerca de Ibon

Me gusta salir a correr, pasear, andar en bici y patinar :) Si no te saludo es que, o no llevo las gafas puestas o que tengo mal día. Pero no te lo tomes a mal: seguro que mañana estoy de mejor humor ;) Me gusta escuchar algunos podcasts sobre divulgación científica: Coffee Break, CienciaES, y algunos otros que divulgan buen karma. Creo en los principios que fundamentan el Software Libre, y me parece una gran herramienta para conseguir una sociedad mas justa.
Esta entrada fue publicada en Programación y etiquetada , , , . Guarda el enlace permanente.

Deja una respuesta

Tu dirección de correo electrónico no será publicada. Los campos obligatorios están marcados con *

Este sitio usa Akismet para reducir el spam. Aprende cómo se procesan los datos de tus comentarios.