mirror of
https://github.com/openSUSE/osem.git
synced 2026-08-02 10:26:46 -04:00
19 lines
464 B
Ruby
19 lines
464 B
Ruby
# frozen_string_literal: true
|
|
|
|
RSpec.configure do |config|
|
|
config.before(:suite) do
|
|
DatabaseCleaner.clean_with(:truncation)
|
|
Rails.application.load_seed
|
|
end
|
|
|
|
config.before(:each) do |example|
|
|
DatabaseCleaner.strategy = example.metadata[:js] == true ? :truncation : :transaction
|
|
DatabaseCleaner.start
|
|
end
|
|
|
|
config.after(:each) do |example|
|
|
DatabaseCleaner.clean
|
|
Rails.application.load_seed if example.metadata[:js] == true
|
|
end
|
|
end
|