私は Cucumber にかなり慣れていないため、このシナリオの最後のステップで問題が発生しています。
Scenario:
Given I am on the sign up page
When I create an account
Then a new list should be created for my account at the same time
私のモデル:
User has_one :list, dependent: :destroy
List belongs_to :user
ステップの定義 (ステップ 3 には何もありません)
Given(/^I am on the sign up page$/) do
visit new_user_registration_path
end
When(/^I create an account$/) do
fill_in 'Username', with: 'Test'
fill_in 'Email', with: 'test@example.com'
fill_in 'Password', with: 'abc12345'
fill_in 'Password confirmation', with: 'abc12345'
click_button 'Submit sign up'
end
Then(/^a new list should be created for me at the same time$/) do
pending
end
ステップ定義は最後のステップをどのように探すべきですか? 基本的に、新しいユーザーが作成された後、関連するリストが同時に作成されるようにしたいだけです。
pickle の gem を見てきましたが、私はまだこれに慣れていないので、pickle_steps.rb ファイルに関連するステップがあるかどうかはよくわかりません。
ありがとう!