我正在结合使用 Cucumber、Webrat 和 Pickle。当我写一个场景时,我可以做这样的事情:
Given a product exists with title: "Bread"
When I go to the edit page for that product
And I fill in "Title" with "Milk"
And I press "Save changes"
Then I should see "Successfully edited product."
And I should be on that car's page
注意for that product
. 这是 pickle 提供的东西,对于引用我正在检查其存在的产品的记录非常方便。但是,最后一行不起作用。
基本上我试图确保我是该记录的显示页面,但由于我没有它的 ID,我不知道如何引用它。
有什么帮助吗?谢谢!