黄瓜:找到期望之一的场景:评论,功能,标签

时间:2013-08-31 17:38:38

标签: ruby-on-rails ruby-on-rails-3 cucumber

我正在尝试进行黄瓜测试但是我遇到了一个奇怪的错误!使用gem 'cucumber-rails', '1.0.6'

features/hidden_links.feature: Parse error at features/hidden_links.feature:1. Found scenario when expecting one of: comment, feature, tag. (Current state: root). (Gherkin::Parser::ParseError)

隐藏链接。功能

Scenario: Edit project link is hidden for non-signed-in users
  Given I am on the homepage
  When I follow "TextMate 2"
  Then I should not see the "Edit Project" link

Scenario: Edit project link is hidden for signed-in user
  Given I am signed in as "user@ticketee.com"
  When I follow "TextMate 2"
  Then I should not see the "Edit Project" link

Scenario: Edit project link is shown to admin
  Given I am signed in as "admin@ticketee.com"
  When I follow "TextMate 2"
  Then I should see the "Edit Proeject" link

Scenario: Delete project link is hidden for non-signed-in users
  Given I am on the homepage
  When I follow "TextMate 2"
  Then I should not see the "Delete Project" link

Scenario: Delete project link is hidden for signed-in users
  Given I am signed in as "user@ticketee.com"
  When I follow "TextMate 2"
  Then I should not see the "Delete Project" link

Scenario: Delete project link is shown to admins
  Given I am signed in as "admin@ticketee.com"
  When I follow "TextMate 2"
  Then I should see the "Delete Project" link

1 个答案:

答案 0 :(得分:2)

功能文件should start from Feature keyword, not from Scenario

Feature: Hidden links