Skip to content

Feature organization

David Leal edited this page Jul 12, 2013 · 2 revisions

Organize your features to reflect your application's organization.

  • Use submodules.
  • Use dedicated support directories.
    • Factories
    • Models
    • Widgets

Say you have the following organization:

app/
  authentication/
    .../
  checkout/
  reporting/

then consider the following feature organization:

features/
  authentication/
    step_definitions/
    support/
      factories/
      models/
      widgets/
  checkout/
  reporting/
  step_definitions/
  support/
    factories/
    models/
    widgets/

Shared code

Put shared code one directory level above the modules that use it.

Tag scenarios (or features) that use shared steps with tags that are similar to the names of the files that contain the shared steps. For example, you would tag scenarios that use shared steps from a file called account_locking_steps.rb with @account-locking. This makes it easier to understand which scenarios use the shared steps, and at the same time, provides a neat way to categorize your scenarios.

Clone this wiki locally