2015-08-13 15:55:19 +02:00
|
|
|
RSpec.configure do |config|
|
2015-09-21 17:59:03 +02:00
|
|
|
expect_list = %w()
|
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
|
|
|
|
DatabaseCleaner.strategy = :truncation, { except: expect_list }
|
|
|
|
end
|
|
|
|
|
2015-08-13 15:55:19 +02:00
|
|
|
config.before(:each) do
|
|
|
|
DatabaseCleaner.start
|
|
|
|
end
|
|
|
|
|
|
|
|
config.after(:each) do
|
|
|
|
DatabaseCleaner.clean
|
|
|
|
end
|
|
|
|
end
|