Playing with Capybara
Continuing my work in Rails, this past week I worked on implementing some Feature Specs using RSpec and Capybara.
Although I've heard about Capybara (the gem) I was curious about the name. I have a problem with learning a tool without knowing why it has some weird name. Apparently a Capybara is a very large rodent. Cute yes? I really wish I had thought of that awesome name.
What I took away from working with Capybara...
- Capybara has it's own DSL.
- Learning some XPath will come in handy.
- Use helpers to clean up your code.
- Use Launchy to debug and view what Capybara is viewing.
- The save_and_open_page method will allow you to open the page in the browser. Its a rather long method name which is why I wrote it here.
EDIT: I was just notified that before Capybara there was another feature testing gem called Webrat, Capybara seems to follow the rodent theme.













