Rails 5.1 requires ActionController::TestRequest to have a controller class

Pass it in as an anonymous class
This commit is contained in:
Matthew Rudy Jacobs
2017-02-26 20:56:19 +00:00
committed by Justin Coyne
parent 36613b09d7
commit 7c4e8c8d17
3 changed files with 21 additions and 3 deletions

View File

@@ -3,7 +3,11 @@ unless defined?(DEVISE_ORM)
end
module Devise
# Detection for minor differences between Rails 4 and 5 in tests.
# Detection for minor differences between Rails 4 and 5, and 5.1 in tests.
def self.rails51?
Rails.version.start_with? '5.1'
end
def self.rails5?
Rails.version.start_with? '5'
end