From 45e714776ebcbb13d6f40f67d2a6414820e362f0 Mon Sep 17 00:00:00 2001 From: Benjamin Neff Date: Sun, 3 Sep 2017 23:43:29 +0200 Subject: [PATCH] Don't truncate ar_internal_metadata after cucumber scenarios This is an internal active record table and shouldn't be touched. When this is truncated you need to fix it again by running `bin/rails db:environment:set RAILS_ENV=test` This is a temporary fix until there is a new version of database_cleaner. closes #7606 --- features/support/env.rb | 3 +++ 1 file changed, 3 insertions(+) diff --git a/features/support/env.rb b/features/support/env.rb index cf95b37ef..f8ebb4a00 100644 --- a/features/support/env.rb +++ b/features/support/env.rb @@ -51,6 +51,9 @@ Capybara.default_max_wait_time = 30 # of your scenarios, as this makes it hard to discover errors in your application. ActionController::Base.allow_rescue = false +# TODO: Temporary fix for rails 5, remove the next line after a new version of database_cleaner is released. +# See https://github.com/DatabaseCleaner/database_cleaner/issues/445 +Cucumber::Rails::Database.javascript_strategy = :truncation, {except: %w[ar_internal_metadata]} Cucumber::Rails::Database.autorun_database_cleaner = true Cucumber::Rails::World.use_transactional_tests = false