stadtratmonitor/spec/support/database_cleaner.rb

24 lines
433 B
Ruby
Raw Permalink Normal View History

2020-03-09 11:27:52 +01:00
# frozen_string_literal: true
2016-02-24 11:59:52 +01:00
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