【发布时间】:2013-02-13 21:16:53
【问题描述】:
我是 rails、cucumber 和 rspec 的新手。为了帮助学习这三个方面,我已经开始构建一个需要登录的真实应用程序。
如果我能从哪里开始并确认我走在正确的道路上,我将不胜感激。
我从 2 个功能文件开始。然而,我已经在这个阶段停止了,因为我想知道“登录”功能(尽管应用程序的核心方面,因为他们不能在没有登录的情况下做任何事情)应该出现在其他资产和模型之后,例如他们登录时管理的事情。
那么,哪个会先出现?登录功能或他们管理的模型的功能?
示例功能文件:
Feature: User loads application
As a user
I want be able to load the application
So that I can manage my files
Scenario: Load application
Given I am not yet using the application
When I visit the application
Then I should see "Welcome to app"
登录功能文件:
Feature: User logs in
As a user
I want be able to login
So that I can manage my private files
Scenario: Successful login
Given the user "Username" has an account
When they login
Then they should see "You have logged in successfully"
我是否应该从他们实际用作应用要点的功能开始?
【问题讨论】:
标签: ruby-on-rails-3 rspec cucumber bdd