test_helper.rb 818 B

1234567891011121314151617181920212223242526272829303132
  1. ENV["RAILS_ENV"] = "test"
  2. require File.expand_path('../../config/environment', __FILE__)
  3. require 'rails/test_help'
  4. require 'simplecov'
  5. require 'simplecov-rcov'
  6. class ActiveSupport::TestCase
  7. # Setup all fixtures in test/fixtures/*.(yml|csv) for all tests in alphabetical order.
  8. #
  9. # Note: You'll currently still have to declare fixtures explicitly in integration tests
  10. # -- they do not yet inherit this setting
  11. SimpleCov.formatter = SimpleCov::Formatter::RcovFormatter
  12. SimpleCov.start
  13. fixtures :all
  14. # disable transactions
  15. self.use_transactional_fixtures = false
  16. # load seeds
  17. load "#{Rails.root}/db/seeds.rb"
  18. setup do
  19. # set current user
  20. puts 'reset UserInfo.current_user_id'
  21. UserInfo.current_user_id = nil
  22. end
  23. # Add more helper methods to be used by all tests here...
  24. end