黄瓜:未定义步骤,尽管应该定义步骤
我已经创建了步骤:
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
我只是看不出我的步骤出了什么问题。我缺少什么? 预先感谢,埃米尔
I have created the step:
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
And I run the cucumber test with:
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
Cucumber states:
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
I just can't see what's wrong with my step. What is it that I'm missing?
Thanks in advance, Emil
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
在您的步骤中,您需要 Twitter 周围的“ ”,因此对 Majbrasa 也使用相同的内容
In your step you need the " " around Twitter so use it same about Majbrasa