1
0
Fork 0
This repository has been archived on 2023-03-27. You can view files and clone it, but cannot push or open issues or pull requests.
lpr-partynest/features/support/database_cleaner.rb

29 lines
913 B
Ruby
Raw Normal View History

# frozen_string_literal: true
2018-12-12 17:00:03 -05:00
Cucumber::Rails::Database.autorun_database_cleaner = false
Cucumber::Rails::World.use_transactional_tests = false
2018-12-12 17:00:03 -05:00
DatabaseCleaner.strategy = :truncation
DatabaseCleaner.clean_with :truncation
2018-12-12 17:00:03 -05:00
Around do |_scenario, block|
DatabaseCleaner.cleaning(&block)
end
# You may also want to configure DatabaseCleaner to use different strategies
# for certain features and scenarios. See the DatabaseCleaner documentation
# for details. Example:
#
# Before('@no-txn,@selenium,@culerity,@celerity,@javascript') do
# # { except: [:widgets] } may not do what you expect here
# # as Cucumber::Rails::Database.javascript_strategy overrides
# # this setting.
# DatabaseCleaner.strategy = :truncation
# end
#
# Before('not @no-txn', 'not @selenium', 'not @culerity', 'not @celerity',
# 'not @javascript') do
# DatabaseCleaner.strategy = :transaction
# end
#