0

I am writing user acceptance tests. The app consists of mock users using factory_girl, which I have not yet implemented. But at this point, poltergeist/turnip/rspec work fine, but I don't like the directory structure and I feel like I am not using turnip correctly as my steps and specs are separate files but share a lot of functionality.

I have this structure:

Gemfile
Gemfile.lock

spec/
│
├── acceptance
│   ├── homepage.feature
│   ├── chat.feature
│   │
│   │── steps
│       ├── homepage_steps.rb
│       ├── chat_steps.rb
│
├── chat_spec.rb
├── spec_helper.rb
└── support
    ├── capybara_helper.rb
    ├── helpers.rb
    ├── poltergeist_helper.rb
    └── turnip_helper.rb 

steps/chat_steps.rb contains

steps_for :group_chat
    step "..." do
    end
end

while spec/acceptance/chat.feature contains

@group_chat
Scenario: ...
    Given ...
    And   ...
    Then  ...

What about chat_spec.rb? should this and the chat_steps.rb files be integrated together?

Is the convention to use spec/acceptance or step/features?

Adrian S.
  • 1
  • 2

1 Answers1

0

Can you give examples of the shared functionality?

chat_spec should presumably contain unit tests for your chat model; I don't understand why that would overlap with chat_steps; if there are common methods you've extracted that are used by both, then just stick them in a separate file

you can put your features in whatever directory you please (i use spec/features), though turnip docs just mention spec/acceptance

fakeleft
  • 2,830
  • 2
  • 30
  • 32