Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/ruby-on-rails/62.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Ruby on rails 行动指南_Ruby On Rails_Cucumber - Fatal编程技术网

Ruby on rails 行动指南

Ruby on rails 行动指南,ruby-on-rails,cucumber,Ruby On Rails,Cucumber,我正在使用,但是我对这个场景有一个问题 Feature: Viewing projects In order to assign tickets to a project As a user I want to be able to see a list of available projects Scenario: Listing all projects Given there is a project called "TextMate 2" And I am on th

我正在使用,但是我对这个场景有一个问题

Feature: Viewing projects
In order to assign tickets to a project
As a user
I want to be able to see a list of available projects


Scenario: Listing all projects
    Given there is a project called "TextMate 2"
    And I am on the homepage
    When I follow "TextMate 2"
    Then I should be on the project page for "TextMate 2"

我目前在编写黄瓜场景时遇到问题。这本书有点过时了。有谁知道有一个博客或网站修复了cucumber的修订版?我找到了这个,但它只有在

中,如果您使用的是cucumber的最新版本,它不再支持web步骤,例如“我遵循”“我看到”,因为它们无助于描述系统的行为。最好使用最新版本并重构您的步骤

Given a project exists in the system
When I view the project
Then the correct data should be displayed
这允许您将web步骤内容(
I follow
I should
等)移动到场景步骤本身中,并使您的场景更具表现力,而无需不必要的细节

如果这听起来不吸引人,或者你想按照书中的例子来做,我建议你使用cucumber的旧版本,1.0.6应该足够低,但请检查他们在书中使用的版本

这就是说,我强烈推荐第一种选择,这样你就可以学会很好地使用黄瓜了