黄瓜:未定义的步骤,尽管应该定义步骤

我创建了这个步骤:

Given /^the feed "([^"]*)" has an item "([^"]*)" published at "([^"]*)"$/ do |feed_name, feed_item_title, published_at| feed = Feed.find_by_name(feed_name) FeedItem.make(:feed => feed, :title => feed_item_title, :published_at => published_at) end 

我用以下方法进行黄瓜测试:

 Scenario: feed items should be sorted by date Given I am signed into an account called "GT" as a customer And there is a social feed called "Twitter" for the account "GT" And the feed Twitter has an item Majbrasa published at "2010-05-01" --- more follows 

黄瓜说:

 7 steps (4 skipped, 1 undefined, 2 passed) You can implement step definitions for undefined steps with these snippets: Given /^the feed Twitter has an item Majbrasa published at "([^"]*)"$/ do |arg1| pending # express the regexp above with the code you wish you had end 

我只是看不出我的步骤有什么问题。 我错过了什么? 先谢谢,埃米尔

在你的步骤中,你需要在Twitter周围的“”,所以使用相同的Majbrasa

 Scenario: feed items should be sorted by date Given I am signed into an account called "GT" as a customer And there is a social feed called "Twitter" for the account "GT" And the feed "Twitter" has an item "Majbrasa" published at "2010-05-01"