Skip to content

Instantly share code, notes, and snippets.

@dougjohnston
Created January 15, 2018 22:46
Show Gist options
  • Save dougjohnston/68f1ac9eec1cefc4923ecb9529f2c5ce to your computer and use it in GitHub Desktop.
Save dougjohnston/68f1ac9eec1cefc4923ecb9529f2c5ce to your computer and use it in GitHub Desktop.
config.before(:suite) do
raise 'Don\'t use transactional fixtures!' if config.use_transactional_fixtures?
puts 'Making sure the portal schema is loaded and accessible'
Rails.application.load_tasks
Rake::Task['db:test:load_portal'].invoke
DatabaseCleaner.clean_with(:truncation)
end
config.before(:each) do
DatabaseCleaner.strategy = :transaction
end
config.before(:each, js: true) do
DatabaseCleaner.strategy = :truncation, { except: %w[room_types promotion_types] }
DatabaseCleaner.clean
end
config.before(:each) do
DatabaseCleaner.start
end
config.append_after(:each) do
DatabaseCleaner.clean
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment