Clean up DatabaseCleaner usage

This commit is contained in:
Hernan Schmidt 2016-08-16 19:02:59 +02:00 committed by Hernán Schmidt
parent c6be0999b9
commit 244172a9bc
2 changed files with 1 additions and 18 deletions

View file

@ -55,15 +55,9 @@ RSpec.configure do |config|
# --seed 1234 # --seed 1234
config.order = 'random' config.order = 'random'
# Setting up DB cleaning to maintain empty rows
config.before(:suite) do
DatabaseCleaner.strategy = :transaction
DatabaseCleaner.clean_with(:truncation)
end
config.around(:each) do |example| config.around(:each) do |example|
DatabaseCleaner.cleaning do DatabaseCleaner.cleaning do
load "#{Rails.root}/db/seeds.rb" Rails.application.load_seed
example.run example.run
end end
end end
@ -89,15 +83,12 @@ RSpec.configure do |config|
c.syntax = :expect c.syntax = :expect
end end
config.use_transactional_fixtures = true
# Reuse rspec as mocking framework # Reuse rspec as mocking framework
config.mock_framework = :rspec config.mock_framework = :rspec
# Types of tests (controller, feature, model) will # Types of tests (controller, feature, model) will
# be inferred from subfolder name # be inferred from subfolder name
config.infer_spec_type_from_file_location! config.infer_spec_type_from_file_location!
end end
OmniAuth.config.test_mode = true OmniAuth.config.test_mode = true

View file

@ -10,12 +10,4 @@ RSpec.configure do |config|
config.before(:each, js: true) do config.before(:each, js: true) do
DatabaseCleaner.strategy = :truncation DatabaseCleaner.strategy = :truncation
end end
config.before(:each) do
DatabaseCleaner.start
end
config.after(:each) do
DatabaseCleaner.clean
end
end end