cloud9を使ってRuby on Rails 5 速習実践ガイドを用いて学習中です。
RSpecのコードを書いた後にテストを走らせてみると
NoMethodError: undefined method `strip' for nil:NilClass
というエラーがでました。いろいろと調べ、chromを入れたり、driverをいれたりと試したのですが、依然とエラーは変わりませんでした。なにが原因なのでしょう。
require "rails_helper" describe "タスク管理機能", type: :system do describe "一覧表示機能" do before do user_a = FactoryBot.create(:user, name: "ユーザーA", email: "a@example.com") FactoryBot.create(:task, name: "最初のタスク", user: user_a) end context "ユーザーAがログインしているとき" do before do visit login_path fill_in "メールアドレス", with: "a@example.com" fill_in "パスワード", with: "password" click_button "ログインする" end it "ユーザーAが作成したタスクが表示される" do expect(page).to have_content "最初のタスク" end end end end
あなたの回答
tips
プレビュー