Ruby on rails 未定义的酸洗步骤(再次)

Ruby on rails 未定义的酸洗步骤(再次),ruby-on-rails,cucumber,pickle,Ruby On Rails,Cucumber,Pickle,-这篇文章对我帮助不大 档案: gem 'rails' # 3.0.5 gem 'capybara' # 1.1.1 gem 'rspec-rails' # 2.6.1 gem 'cucumber-rails' # 1.0.5 gem 'database_cleaner' gem 'factory_girl_rails' # 1.2.0 gem 'email_spec' gem 'pickle' # 0.4.8 我有: 我有: $ cucumber Using the default prof

-这篇文章对我帮助不大

档案:

gem 'rails' # 3.0.5
gem 'capybara' # 1.1.1
gem 'rspec-rails' # 2.6.1
gem 'cucumber-rails' # 1.0.5
gem 'database_cleaner'
gem 'factory_girl_rails' # 1.2.0
gem 'email_spec'
gem 'pickle' # 0.4.8
我有:

我有:

$ cucumber
Using the default profile...
Feature: Manage categories

  Scenario: list existed categories                       # features/manage_categories.feature:3
    Given a category exists, title: "First category ever" # features/manage_categories.feature:4
      Undefined step: "a category exists, title: "First category ever"" (Cucumber::Undefined)
      features/manage_categories.feature:4:in `Given a category exists, title: "First category ever"'
    When I go to the categories page                      # features/step_definitions/web_steps.rb:48
    Then I should see "First category ever"               # features/step_definitions/web_steps.rb:105

1 scenario (1 undefined)
3 steps (2 skipped, 1 undefined)
0m0.127s

You can implement step definitions for undefined steps with these snippets:

Given /^a category exists, title: "([^"]*)"$/ do |arg1|
  pending # express the regexp above with the code you wish you had
end
请注意,我没有做任何配置这个测试应用程序无论如何,我没有使用工厂女孩或任何东西,而不是ActiveRecord。我相信从那以后它会起作用。Pickle本身通过puts加载测试,cucumber使用environments/test.rb运行


我遗漏了什么?

您的步骤定义没有使用正确的措辞

默认的Pickle步骤您可以根据自己的应用程序/风格进行调整,但以下步骤除外:

给定一个类别,其标题为:有史以来第一个类别

干杯,
伊恩

对于迟来的反馈表示抱歉。即使我遵循指南也会这样说:您可以使用以下代码段为未定义的步骤实现步骤定义:给定/^存在一个类别,标题为:[^]*$/do | arg1 | pending express上面的regexp和您希望的代码endQuestion已关闭-问题在FactoryGirl中。
$ cucumber
Using the default profile...
Feature: Manage categories

  Scenario: list existed categories                       # features/manage_categories.feature:3
    Given a category exists, title: "First category ever" # features/manage_categories.feature:4
      Undefined step: "a category exists, title: "First category ever"" (Cucumber::Undefined)
      features/manage_categories.feature:4:in `Given a category exists, title: "First category ever"'
    When I go to the categories page                      # features/step_definitions/web_steps.rb:48
    Then I should see "First category ever"               # features/step_definitions/web_steps.rb:105

1 scenario (1 undefined)
3 steps (2 skipped, 1 undefined)
0m0.127s

You can implement step definitions for undefined steps with these snippets:

Given /^a category exists, title: "([^"]*)"$/ do |arg1|
  pending # express the regexp above with the code you wish you had
end