test-unitでのシステムテストでちょっとハマったのでメモ。 症状 テスト実行時にログイン処理が不安定(ログインできる/できない)という症状が発生。 class BooksTest < ApplicationSystemTestCase setup do @book = books(:one) # ログイン処理 visit root_url fill_in 'Eメール', with: 'alice@example.com' fill_in 'パスワード', with: 'password' click_on 'ログイン' end test 'visiting the index' do v…