integration_test_helper.rb 800 B

12345678910111213141516171819202122232425262728293031323334353637
  1. ENV['RAILS_ENV'] = 'test'
  2. require File.expand_path('../../config/environment', __FILE__)
  3. require 'rails/test_help'
  4. require 'cache'
  5. class ActiveSupport::TestCase
  6. # disable transactions / to work with own database connections for each thread
  7. self.use_transactional_tests = false
  8. ActiveRecord::Base.logger = Rails.logger.clone
  9. ActiveRecord::Base.logger.level = Logger::INFO
  10. # clear cache
  11. Cache.clear
  12. # load seeds
  13. load Rails.root.join('db', 'seeds.rb')
  14. load Rails.root.join('test', 'fixtures', 'seeds.rb')
  15. setup do
  16. # clear cache
  17. Cache.clear
  18. # reload settings
  19. Setting.reload
  20. # remove all session messages
  21. Sessions.cleanup
  22. # set current user
  23. UserInfo.current_user_id = nil
  24. end
  25. # Add more helper methods to be used by all tests here...
  26. end