I have upgraded rspec to version 3.2 and now I get a lot of database errors (Mysql2::Error: Duplicate entry
) when I run the specs. The specs seems to be running in parallel. I am using the database cleaner gem (1.4.1), and it was working before the upgrade. What is happening? Here is my spec_helper file:
Capybara.javascript_driver = :webkit
RSpec.configure do |config|
config.filter_run_excluding :broken => true
config.filter_run :focus => true
config.run_all_when_everything_filtered = true
config.infer_spec_type_from_file_location!
config.infer_base_class_for_anonymous_controllers = false
config.order = "random"
config.before(:suite) do
DatabaseCleaner.strategy = :truncation
DatabaseCleaner.strategy = :deletion, {except: %w[users]}
DatabaseCleaner.clean_with(:truncation)
end
config.before(:each) do
DatabaseCleaner.start
end
config.after(:each) do
DatabaseCleaner.clean
end
end