Ruby初学者です。
現在ポートフォリオのRspecを行なっております。
ユーザのログイン部分のテストをリファクタリングしたく、
supportの中で定義したのですが、上手く読み込んでくれません。
ご教授頂けますと幸いです。
【エラー内容】
Failure/Error: include LoginSupport NameError: uninitialized constant LoginSupport
【コード】
spec/support/login_support.rb
module LoginSupport def sign_in_as(user) visit root_path within('.box__area') do click_on "ログイン" end fill_in "メールアドレス",with: user.email fill_in"パスワード",with: user.password click_on "ログインする" visit user_path(user) expect(page).to have_content "ログインしました。" end end RSpec.configure do |config| config.include LoginSupport end
features/user_spec.rb
RSpec.feature "Users", type: :feature do include LoginSupport
回答1件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。