mirror of
https://github.com/CodeforLeipzig/stadtratmonitor.git
synced 2025-04-20 07:11:33 +02:00
Add database_cleaner gem
This commit is contained in:
parent
80a67d094d
commit
3e27d8e82f
4 changed files with 26 additions and 1 deletions
22
spec/support/database_cleaner.rb
Normal file
22
spec/support/database_cleaner.rb
Normal file
|
@ -0,0 +1,22 @@
|
|||
RSpec.configure do |config|
|
||||
config.before(:suite) do
|
||||
DatabaseCleaner.clean_with(:truncation)
|
||||
end
|
||||
|
||||
config.before(:each) do
|
||||
DatabaseCleaner.strategy = :transaction
|
||||
end
|
||||
|
||||
config.before(:each, type: :feature) do
|
||||
DatabaseCleaner.strategy = :truncation
|
||||
end
|
||||
|
||||
config.before(:each) do
|
||||
DatabaseCleaner.start
|
||||
end
|
||||
|
||||
config.append_after(:each) do
|
||||
DatabaseCleaner.clean
|
||||
end
|
||||
|
||||
end
|
Loading…
Add table
Add a link
Reference in a new issue