私はこのシナリオを持っています:
Given I am on the edit_stamp page
And I change the date to "14.5.2010" #<-- i need this data
...
Then I should see that the new times has been set #<-- down here
私は基本的にモデルの日付を更新しています.最後のステップでは、最初のステップで選択した日付でモデルが実際に更新されたことを確認したいと思います.
最後のステップ定義で、選択した日付を上から取得するにはどうすればよいですか?
Then(/^I should see that the new times has been set$/) do
s = Stamp.first
find_by_id("day_date#{s.id}").has_text?("14.5.2010")
end
これは私が今持っているものですが、日付(14.5.2010)をステップ定義に書きたくないので、前のステップから取得したいと思います。