mirror of
https://github.com/openSUSE/osem.git
synced 2026-08-13 19:54:02 +00:00
Merge pull request #1541 from siddhantbajaj/travis
Improved test performance.
This commit is contained in:
commit
4d895ae3bc
2 changed files with 20 additions and 4 deletions
|
|
@ -1,6 +1,16 @@
|
|||
RSpec.configure do |config|
|
||||
config.before(:each) do
|
||||
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
|
||||
|
|
|
|||
|
|
@ -4,9 +4,15 @@ RSpec.configure do |config|
|
|||
|
||||
config.before(:suite) do
|
||||
if ENV['OSEM_FACTORY_LINT'] != 'false'
|
||||
mock_commercial_request
|
||||
FactoryGirl.lint
|
||||
DatabaseCleaner.strategy = :transaction
|
||||
DatabaseCleaner.clean_with(:truncation)
|
||||
begin
|
||||
DatabaseCleaner.start
|
||||
mock_commercial_request
|
||||
FactoryGirl.lint
|
||||
ensure
|
||||
DatabaseCleaner.clean
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
end
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue