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-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
|
|
|
|
2014-09-01 17:47:08 -04:00
|
|
|
# Devise test suite is order dependent, and we need to ensure that same order
|
|
|
|
# in Rails 4.2.0.
|
|
|
|
ActiveSupport::TestCase.my_tests_are_order_dependent!
|
|
|
|
|
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"
|