mirror of
https://github.com/rails/rails.git
synced 2022-11-09 12:12:34 -05:00
issue a warning when we cannot construct a controller
This commit is contained in:
parent
f79b29a5a8
commit
1f870a2c59
1 changed files with 10 additions and 2 deletions
|
@ -529,11 +529,19 @@ module ActionController
|
|||
@response = TestResponse.new
|
||||
@response.request = @request
|
||||
|
||||
@controller = nil unless defined? @controller
|
||||
|
||||
if klass = self.class.controller_class
|
||||
@controller ||= klass.new rescue nil
|
||||
unless @controller
|
||||
begin
|
||||
@controller = klass.new
|
||||
rescue
|
||||
warn "could not construct controller #{klass}" if $VERBOSE
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
if defined?(@controller) && @controller
|
||||
if @controller
|
||||
@controller.request = @request
|
||||
@controller.params = {}
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue