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|
|
RSpec.configure do |config|
|
||||||
config.before(:each) do
|
config.before(:suite) do
|
||||||
DatabaseCleaner.clean_with(:truncation)
|
DatabaseCleaner.clean_with(:truncation)
|
||||||
Rails.application.load_seed
|
Rails.application.load_seed
|
||||||
end
|
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
|
end
|
||||||
|
|
|
||||||
|
|
@ -4,9 +4,15 @@ RSpec.configure do |config|
|
||||||
|
|
||||||
config.before(:suite) do
|
config.before(:suite) do
|
||||||
if ENV['OSEM_FACTORY_LINT'] != 'false'
|
if ENV['OSEM_FACTORY_LINT'] != 'false'
|
||||||
mock_commercial_request
|
DatabaseCleaner.strategy = :transaction
|
||||||
FactoryGirl.lint
|
DatabaseCleaner.clean_with(:truncation)
|
||||||
|
begin
|
||||||
|
DatabaseCleaner.start
|
||||||
|
mock_commercial_request
|
||||||
|
FactoryGirl.lint
|
||||||
|
ensure
|
||||||
|
DatabaseCleaner.clean
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue