Bugfix for missing ActionController::TestRequest

Fixed a bug where helpers were used inside a decorator and this decorator was used outside of controller context
This commit is contained in:
Moritz Kröger 2016-10-31 12:08:54 +01:00
parent ab51bf06d1
commit 97b0bc4240
2 changed files with 3 additions and 1 deletions

View File

@ -1,5 +1,7 @@
# Draper Changelog
* Fixed a bug where helpers were used inside a decorator and this decorator was used outside of controller context
## 3.0.0.pre1 - 2016-07-10
* Added support for Rails 5, dropped 4.0 - 4.2

View File

@ -38,7 +38,7 @@ module Draper
def controller
(Draper::ViewContext.controller || ApplicationController.new).tap do |controller|
controller.request ||= new_test_request controller
controller.request ||= new_test_request controller if defined?(ActionController::TestRequest)
end
end