test_helper.rb 797 B

123456789101112131415161718192021222324252627
  1. ENV["RAILS_ENV"] = "test"
  2. DEVISE_ORM = (ENV["DEVISE_ORM"] || :active_record).to_sym
  3. $:.unshift File.dirname(__FILE__)
  4. puts "\n==> Devise.orm = #{DEVISE_ORM.inspect}"
  5. require "rails_app/config/environment"
  6. require "rails/test_help"
  7. require "orm/#{DEVISE_ORM}"
  8. I18n.load_path << File.expand_path("../support/locale/en.yml", __FILE__)
  9. require 'mocha'
  10. require 'webrat'
  11. Webrat.configure do |config|
  12. config.mode = :rails
  13. config.open_error_files = false
  14. end
  15. # Add support to load paths so we can overwrite broken webrat setup
  16. $:.unshift File.expand_path('../support', __FILE__)
  17. Dir["#{File.dirname(__FILE__)}/support/**/*.rb"].each { |f| require f }
  18. # For generators
  19. require "rails/generators/test_case"
  20. require "generators/devise/install_generator"
  21. require "generators/devise/views_generator"