trabajo-afectivo/test/integration_test_helper.rb

50 lines
1 KiB
Ruby
Raw Permalink Normal View History

# Copyright (C) 2012-2021 Zammad Foundation, http://zammad-foundation.org/
ENV['RAILS_ENV'] = 'test'
2018-04-12 14:57:37 +00:00
require File.expand_path('../config/environment', __dir__)
2014-11-14 06:42:39 +00:00
require 'rails/test_help'
require 'cache'
require 'test_support_helper'
2015-04-27 21:01:04 +00:00
class ActiveSupport::TestCase
2017-11-06 01:32:47 +00:00
# disable transactions / to work with own database connections for each thread
self.use_transactional_tests = false
2014-11-14 06:42:39 +00:00
2017-06-14 15:25:45 +00:00
ActiveRecord::Base.logger = Rails.logger.clone
ActiveRecord::Base.logger.level = Logger::INFO
2015-04-27 21:01:04 +00:00
# clear cache
Cache.clear
2014-11-14 06:42:39 +00:00
2015-04-27 21:01:04 +00:00
# load seeds
load Rails.root.join('db/seeds.rb')
load Rails.root.join('test/fixtures/seeds.rb')
2014-11-14 06:42:39 +00:00
# set system mode to done / to activate
Setting.set('system_init_done', true)
setup do
2015-02-25 23:44:29 +00:00
2015-04-27 21:01:04 +00:00
# clear cache
Cache.clear
2014-11-14 06:42:39 +00:00
2017-11-06 01:32:47 +00:00
# reload settings
Setting.reload
2017-06-14 15:25:45 +00:00
# remove all session messages
Sessions.cleanup
# remove old delayed jobs
Delayed::Job.destroy_all
2015-04-27 21:01:04 +00:00
# set current user
UserInfo.current_user_id = nil
travel_back
2015-04-27 20:49:17 +00:00
end
2015-04-27 21:01:04 +00:00
# Add more helper methods to be used by all tests here...
end