1
0
Fork 0
mirror of https://github.com/heartcombo/devise.git synced 2022-11-09 12:18:31 -05:00
heartcombo--devise/test/test_helper.rb
Lucas Mazza 7dce5baf6c Devise tests are order dependent.
Until 4.2.0, any test suite based on the `TestCase` classes provided by Rails would
always run into alphabetical, but now they run in random order. For now, we ensure
that our tests always run in alphabetical order.

Related commit on rails/rails
6ffb29d24e
2014-09-01 18:47:08 -03:00

33 lines
1,004 B
Ruby

ENV["RAILS_ENV"] = "test"
DEVISE_ORM = (ENV["DEVISE_ORM"] || :active_record).to_sym
$:.unshift File.dirname(__FILE__)
puts "\n==> Devise.orm = #{DEVISE_ORM.inspect}"
require "rails_app/config/environment"
require "rails/test_help"
require "orm/#{DEVISE_ORM}"
I18n.load_path << File.expand_path("../support/locale/en.yml", __FILE__)
require 'mocha/setup'
require 'webrat'
Webrat.configure do |config|
config.mode = :rails
config.open_error_files = false
end
OmniAuth.config.logger = Logger.new('/dev/null')
# Add support to load paths so we can overwrite broken webrat setup
$:.unshift File.expand_path('../support', __FILE__)
Dir["#{File.dirname(__FILE__)}/support/**/*.rb"].each { |f| require f }
# 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!
# For generators
require "rails/generators/test_case"
require "generators/devise/install_generator"
require "generators/devise/views_generator"