mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-02-27 01:43:22 +00:00
Fix database cleaner strategy: http://blog.55minutes.com/2012/05/faster-capybara-specs/
This commit is contained in:
@@ -48,22 +48,15 @@ Spork.prefork do
|
||||
#
|
||||
config.filter_run_excluding :skip => true
|
||||
|
||||
config.before(:suite) do
|
||||
DatabaseCleaner.strategy = :transaction
|
||||
end
|
||||
|
||||
config.before(:each) do
|
||||
if example.metadata[:js]
|
||||
DatabaseCleaner.strategy = :truncation, { :except => ['spree_countries', 'spree_states'] }
|
||||
else
|
||||
DatabaseCleaner.strategy = :transaction
|
||||
end
|
||||
DatabaseCleaner.start
|
||||
end
|
||||
|
||||
config.before(type: :request, js: true) do
|
||||
DatabaseCleaner.strategy = :truncation, { :except => ['spree_countries', 'spree_states'] }
|
||||
end
|
||||
|
||||
config.before(js: false) do
|
||||
DatabaseCleaner.strategy = :transaction
|
||||
end
|
||||
|
||||
config.after(:each) do
|
||||
DatabaseCleaner.clean
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user