trabajo-afectivo/test/integration_test_helper.rb

38 lines
785 B
Ruby
Raw Normal View History

ENV['RAILS_ENV'] = 'test'
2014-11-14 06:42:39 +00:00
require File.expand_path('../../config/environment', __FILE__)
require 'rails/test_help'
require 'cache'
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}/db/seeds.rb"
2016-04-26 09:57:29 +00:00
load "#{Rails.root}/test/fixtures/seeds.rb"
2014-11-14 06:42:39 +00:00
2015-04-27 21:01:04 +00:00
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
2015-04-27 21:01:04 +00:00
# set current user
UserInfo.current_user_id = nil
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