こんばんわ。
rspecでjsのテストをしようと、database_cleanerを導入しました。
個別テストは通るのですが、全体テストをすると落ちてしまいます。
rails_helper
config.use_transactional_fixtures = false config.before(:suite) do DatabaseCleaner.clean_with :truncation # start test database clean end config.before(:each) do DatabaseCleaner.strategy = :transaction end config.before(:each, js: true) do DatabaseCleaner.strategy = :truncation end config.before(:each) do DatabaseCleaner.start end config.after(:each) do DatabaseCleaner.clean end config.after(:all) do DatabaseCleaner.clean_with :truncation # all test db clean end
エラー内容です。
2.1) Failure/Error: @user = create(:papasu) ActiveRecord::StatementInvalid: SQLite3::BusyException: database is locked: INSERT INTO "users" ("id", "email", "salt", "crypted_password", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?, ?)
なんで全体テストの時に落ちるのかが理解できません。
よろしければご教授をお願いします。
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。