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 を持っていないため、参照する方法がわかりません。
何か助けはありますか?ありがとう!