非轨道应用程序中的Turnip/rspec/steps dir结构

非轨道应用程序中的Turnip/rspec/steps dir结构,rspec,integration-testing,bdd,user-acceptance-testing,Rspec,Integration Testing,Bdd,User Acceptance Testing,我正在编写用户验收测试。该应用程序由使用factory_girl的模拟用户组成,我还没有实现。但在这一点上,poltergeist/turnip/rspec工作得很好,但我不喜欢目录结构,我觉得我没有正确使用turnip,因为我的步骤和规范是独立的文件,但共享很多功能 我有这样的结构: Gemfile Gemfile.lock spec/ │ ├── acceptance │   ├── homepage.feature │   ├── chat.feature │ │ │   │── s

我正在编写用户验收测试。该应用程序由使用factory_girl的模拟用户组成,我还没有实现。但在这一点上,poltergeist/turnip/rspec工作得很好,但我不喜欢目录结构,我觉得我没有正确使用turnip,因为我的步骤和规范是独立的文件,但共享很多功能

我有这样的结构:

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 
步骤/chat_steps.rb包含

steps_for :group_chat
    step "..." do
    end
end
而spec/acceptance/chat.feature包含

@group_chat
Scenario: ...
    Given ...
    And   ...
    Then  ...
那么chat_spec.rb呢?是否应将此文件与chat_steps.rb文件集成在一起


惯例是使用规范/验收还是步骤/功能?

您能给出共享功能的示例吗

chat_规范大概应该包含针对您的聊天模型的单元测试;我不明白为什么这会与聊天步骤重叠;如果您提取了两种常用方法,那么只需将它们放在一个单独的文件中即可

你可以把你的特性放在任何你喜欢的目录中(我使用spec/features),尽管turnip文档只提到spec/acceptance