Chatwoot/spec/cypress/app_commands/clean.rb
Sojan Jose d6f309ce22
Chore: Initialize Cypress tests (#1078)
Addresses: #412

Co-authored-by: Pranav Raj S <pranav@thoughtwoot.com>
2020-07-21 20:11:22 +05:30

10 lines
319 B
Ruby

if defined?(DatabaseCleaner)
# cleaning the database using database_cleaner
DatabaseCleaner.strategy = :truncation
DatabaseCleaner.clean
else
logger.warn 'add database_cleaner or update cypress/app_commands/clean.rb'
Post.delete_all if defined?(Post)
end
Rails.logger.info 'APPCLEANED' # used by log_fail.rb