2015-08-13 15:55:19 +02:00
|
|
|
RSpec.configure do |config|
|
2018-10-01 13:55:12 +02:00
|
|
|
expect_list = []
|
2015-08-24 11:42:06 +02:00
|
|
|
|
2015-08-13 15:55:19 +02:00
|
|
|
config.before(:suite) do
|
2015-08-24 11:42:06 +02:00
|
|
|
DatabaseCleaner.clean_with(:truncation, except: expect_list)
|
2015-08-13 15:55:19 +02:00
|
|
|
end
|
|
|
|
|
|
|
|
config.before(:each) do
|
|
|
|
DatabaseCleaner.strategy = :transaction
|
|
|
|
end
|
|
|
|
|
2015-08-24 11:42:06 +02:00
|
|
|
config.before(:each, js: true) do
|
2019-09-10 16:08:38 +02:00
|
|
|
DatabaseCleaner.strategy = :deletion, { except: expect_list }
|
2015-08-24 11:42:06 +02:00
|
|
|
end
|
|
|
|
|
2015-08-13 15:55:19 +02:00
|
|
|
config.before(:each) do
|
|
|
|
DatabaseCleaner.start
|
|
|
|
end
|
|
|
|
|
|
|
|
config.after(:each) do
|
|
|
|
DatabaseCleaner.clean
|
|
|
|
end
|
|
|
|
end
|