1
0
Fork 0
mirror of https://github.com/heartcombo/devise.git synced 2022-11-09 12:18:31 -05:00
heartcombo--devise/test/rails_app/config/boot.rb
Carlos Antonio da Silva e1c53d6580 Check for empty response body on redirect with Rails main (future 7.1)
Rails is no longer returning a message with the response body on
redirects, just an empty body.

https://github.com/rails/rails/pull/44554
2022-04-22 09:30:58 -03:00

47 lines
988 B
Ruby

# frozen_string_literal: true
unless defined?(DEVISE_ORM)
DEVISE_ORM = (ENV["DEVISE_ORM"] || :active_record).to_sym
end
module Devise
module Test
# Detection for minor differences between Rails versions in tests.
def self.rails71_and_up?
!rails70? && Rails::VERSION::MAJOR >= 7
end
def self.rails70?
Rails.version.start_with? '7.0'
end
def self.rails6_and_up?
Rails::VERSION::MAJOR >= 6
end
def self.rails52_and_up?
Rails::VERSION::MAJOR > 5 || rails52?
end
def self.rails52?
Rails.version.start_with? '5.2'
end
def self.rails51?
Rails.version.start_with? '5.1'
end
def self.rails5_and_up?
Rails::VERSION::MAJOR >= 5
end
def self.rails5?
Rails.version.start_with? '5'
end
end
end
# Set up gems listed in the Gemfile.
ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../../../../Gemfile', __FILE__)
require 'bundler/setup' if File.exist?(ENV['BUNDLE_GEMFILE'])