2017-12-21 12:36:29 -05:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
2009-10-09 20:11:58 -04:00
|
|
|
ENV["RAILS_ENV"] = "test"
|
2009-12-21 09:29:58 -05:00
|
|
|
DEVISE_ORM = (ENV["DEVISE_ORM"] || :active_record).to_sym
|
2009-12-21 15:10:23 -05:00
|
|
|
|
2010-03-28 01:15:52 -04:00
|
|
|
$:.unshift File.dirname(__FILE__)
|
2009-12-21 15:10:23 -05:00
|
|
|
puts "\n==> Devise.orm = #{DEVISE_ORM.inspect}"
|
2010-02-17 04:11:43 -05:00
|
|
|
|
2010-03-28 01:15:52 -04:00
|
|
|
require "rails_app/config/environment"
|
|
|
|
require "rails/test_help"
|
|
|
|
require "orm/#{DEVISE_ORM}"
|
2009-10-07 20:46:40 -04:00
|
|
|
|
2010-03-28 01:15:52 -04:00
|
|
|
I18n.load_path << File.expand_path("../support/locale/en.yml", __FILE__)
|
2009-09-17 08:24:33 -04:00
|
|
|
|
2013-01-25 14:16:40 -05:00
|
|
|
require 'mocha/setup'
|
2010-11-25 21:15:48 -05:00
|
|
|
require 'webrat'
|
2009-10-07 20:46:40 -04:00
|
|
|
Webrat.configure do |config|
|
|
|
|
config.mode = :rails
|
2009-11-22 19:19:29 -05:00
|
|
|
config.open_error_files = false
|
2010-02-16 08:31:49 -05:00
|
|
|
end
|
|
|
|
|
2014-09-29 16:42:08 -04:00
|
|
|
if ActiveSupport.respond_to?(:test_order)
|
|
|
|
ActiveSupport.test_order = :random
|
|
|
|
end
|
|
|
|
|
2014-05-14 22:25:29 -04:00
|
|
|
OmniAuth.config.logger = Logger.new('/dev/null')
|
|
|
|
|
2010-02-16 08:57:10 -05:00
|
|
|
# Add support to load paths so we can overwrite broken webrat setup
|
|
|
|
$:.unshift File.expand_path('../support', __FILE__)
|
2010-11-25 21:15:48 -05:00
|
|
|
Dir["#{File.dirname(__FILE__)}/support/**/*.rb"].each { |f| require f }
|
2010-12-18 02:22:01 -05:00
|
|
|
|
|
|
|
# For generators
|
|
|
|
require "rails/generators/test_case"
|
|
|
|
require "generators/devise/install_generator"
|
2011-02-24 14:50:22 -05:00
|
|
|
require "generators/devise/views_generator"
|
2014-08-24 23:05:54 -04:00
|
|
|
require "generators/devise/controllers_generator"
|