GIANT ROBOTS SMASHING INTO OTHER GIANT ROBOTS

Written by thoughtbot

Cucumber Directory Convention

I’ve been organizing Cucumber features in Rails apps using a strict directory convention:

features/admins/
features/api_clients/
features/users/
features/visitors/

The convention

All features go inside a directory named after a user type (including non-human users such as API clients).

  • Visitors are un-authenticated users.
  • Users are authenticated users.
  • Use domain-specific language. If authenticated users are “editors”, use features/editors instead of features/users.
  • No features are at the top level.

Why

I believe the single-most important attribute of a well-written feature is that it clearly captures the mindset of an end user.

The convention keeps the vocabulary tight and enforces the concept that all stories should be written by walking a mile in the shoes of some one or some system.