BigW Consortium Gitlab

db_cleaner.rb 389 Bytes
Newer Older
1
RSpec.configure do |config|
2 3 4
  config.before(:suite) do
    DatabaseCleaner.clean_with(:truncation)
  end
5

6
  config.before(:each) do
7 8 9
    DatabaseCleaner.strategy = :transaction
  end

10
  config.before(:each, js: true) do
11
    DatabaseCleaner.strategy = :truncation
12 13 14 15 16 17 18 19
  end

  config.before(:each) do
    DatabaseCleaner.start
  end

  config.after(:each) do
    DatabaseCleaner.clean
20 21
  end
end