Skip to content
Browse files

issue a warning when we cannot construct a controller

  • Loading branch information...
1 parent f79b29a commit 1f870a2c5911b2eec519062486a74a725e924b3d @tenderlove tenderlove committed Jul 28, 2012
Showing with 10 additions and 2 deletions.
  1. +10 −2 actionpack/lib/action_controller/test_case.rb
View
12 actionpack/lib/action_controller/test_case.rb
@@ -529,11 +529,19 @@ def setup_controller_request_and_response
@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

0 comments on commit 1f870a2

Please sign in to comment.
Something went wrong with that request. Please try again.