debian-mirror-gitlab/spec/support/db_cleaner.rb

34 lines
687 B
Ruby
Raw Normal View History

2014-09-02 18:07:02 +05:30
RSpec.configure do |config|
config.before(:suite) do
DatabaseCleaner.clean_with(:truncation)
end
2017-08-17 22:00:37 +05:30
config.append_after(:context) do
DatabaseCleaner.clean_with(:truncation)
end
2014-09-02 18:07:02 +05:30
config.before(:each) do
DatabaseCleaner.strategy = :transaction
end
2015-09-11 14:41:01 +05:30
config.before(:each, js: true) do
2014-09-02 18:07:02 +05:30
DatabaseCleaner.strategy = :truncation
end
2017-08-17 22:00:37 +05:30
config.before(:each, truncate: true) do
DatabaseCleaner.strategy = :truncation
end
2017-09-10 17:25:29 +05:30
config.before(:each, :migration) do
DatabaseCleaner.strategy = :truncation, { cache_tables: false }
end
2014-09-02 18:07:02 +05:30
config.before(:each) do
DatabaseCleaner.start
end
2016-09-29 09:46:39 +05:30
config.append_after(:each) do
2014-09-02 18:07:02 +05:30
DatabaseCleaner.clean
end
end