Clean up DatabaseCleaner usage
This commit is contained in:
parent
c6be0999b9
commit
244172a9bc
2 changed files with 1 additions and 18 deletions
|
|
@ -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
|
||||||
|
|
|
||||||
|
|
@ -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
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue