mirror of
https://github.com/heartcombo/devise.git
synced 2022-11-09 12:18:31 -05:00
1192c76f62
If `Confirmable#confirmation_sent_at` is equal to `0.days.ago`, then `confirmation_period_valid?` will be deemed valid even if the setting is configured to disable this outright. To prevent this error, we explicitly check the configuration setting to be `0.days.ago`.
37 lines
1 KiB
Ruby
37 lines
1 KiB
Ruby
# frozen_string_literal: true
|
|
|
|
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 'timecop'
|
|
require 'webrat'
|
|
Webrat.configure do |config|
|
|
config.mode = :rails
|
|
config.open_error_files = false
|
|
end
|
|
|
|
if ActiveSupport.respond_to?(:test_order)
|
|
ActiveSupport.test_order = :random
|
|
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 }
|
|
|
|
# For generators
|
|
require "rails/generators/test_case"
|
|
require "generators/devise/install_generator"
|
|
require "generators/devise/views_generator"
|
|
require "generators/devise/controllers_generator"
|