diff --git a/test/integration_test_helper.rb b/test/integration_test_helper.rb index a19e0d349..0475463fe 100644 --- a/test/integration_test_helper.rb +++ b/test/integration_test_helper.rb @@ -3,27 +3,25 @@ require File.expand_path('../../config/environment', __FILE__) require 'rails/test_help' require 'cache' -module ActiveSupport - class TestCase - # disable transactions - #self.use_transactional_fixtures = false +class ActiveSupport::TestCase + # disable transactions + #self.use_transactional_fixtures = false + + # clear cache + Cache.clear + + # load seeds + load "#{Rails.root}/db/seeds.rb" + + setup do # clear cache Cache.clear - # load seeds - load "#{Rails.root}/db/seeds.rb" - - setup do - - # clear cache - Cache.clear - - # set current user - puts 'reset UserInfo.current_user_id' - UserInfo.current_user_id = nil - end - - # Add more helper methods to be used by all tests here... + # set current user + puts 'reset UserInfo.current_user_id' + UserInfo.current_user_id = nil end + + # Add more helper methods to be used by all tests here... end diff --git a/test/test_helper.rb b/test/test_helper.rb index 66a79882a..b674375e8 100644 --- a/test/test_helper.rb +++ b/test/test_helper.rb @@ -5,38 +5,36 @@ require 'cache' require 'simplecov' require 'simplecov-rcov' -module ActiveSupport - class TestCase - # Setup all fixtures in test/fixtures/*.(yml|csv) for all tests in alphabetical order. - # - # Note: You'll currently still have to declare fixtures explicitly in integration tests - # -- they do not yet inherit this setting - SimpleCov.formatter = SimpleCov::Formatter::RcovFormatter - SimpleCov.start - fixtures :all +class ActiveSupport::TestCase + # Setup all fixtures in test/fixtures/*.(yml|csv) for all tests in alphabetical order. + # + # Note: You'll currently still have to declare fixtures explicitly in integration tests + # -- they do not yet inherit this setting + SimpleCov.formatter = SimpleCov::Formatter::RcovFormatter + SimpleCov.start + fixtures :all - # disable transactions - self.use_transactional_fixtures = false + # disable transactions + self.use_transactional_fixtures = false + + # clear cache + Cache.clear + + # load seeds + load "#{Rails.root}/db/seeds.rb" + + # set system mode to done / to activate + Setting.set('system_init_done', true) + + setup do # clear cache Cache.clear - # load seeds - load "#{Rails.root}/db/seeds.rb" - - # set system mode to done / to activate - Setting.set('system_init_done', true) - - setup do - - # clear cache - Cache.clear - - # set current user - puts 'reset UserInfo.current_user_id' - UserInfo.current_user_id = nil - end - - # Add more helper methods to be used by all tests here... + # set current user + puts 'reset UserInfo.current_user_id' + UserInfo.current_user_id = nil end + + # Add more helper methods to be used by all tests here... end