Dr Blinken

blog, bentosheets and railspages.

Cucumber

Cucumber is an acceptance test frameworks that allows you to describe features in a language called Gherkin which reads almost like English.

About Writing Good Feature Descriptions

In the berkeley saas-course, web_steps.rb and its support scripts are heavily used, which have been generated by the gem cucumber-rails-training-wheels.

In the comments, they warn about using these files and link to the following blog posts about writing good scenarios. I would say the bottom line is to do it more declarative rather than imperative - rather write “When I Add a new Movie” rather than “When I click on the add button” which implies declaring the steps tailored to the specific scenario rather than reusing generic steps as in web_steps.rb which makes the acceptance tests brittle.

Some more on maintable specs

Usage

Turnip

Turnip is an alternative to cucumber that also runs acceptance tests written in Gherkin - it allows you to include them in the spec dir and run them with rspec which also speeds up running all tests. Here’s a Blog article on how to migrate to Turnip: Turnip: a tasty Cucumber alternative?