title: Rails 4.0 RuntimeError: @controller is nil: make sure you set it in your test's setup method
body: <p>When I run controller (or functional) tests, Rails 4.0 fails to auto-instantiate a controller instance (@controller) even though the same tests ran fine in Rails 3.2.<br>
  Any suggestions about how to begin solving this issue? </p>
  
  <p>Sample output:</p>
  
  <pre><code> $ ruby -Ilib:test test/controllers/account_controller_test.rb
  [Coveralls] Set up the SimpleCov formatter.
  [Coveralls] Using SimpleCov's 'rails' settings.
  warning: parser/current is loading parser/ruby21, which recognizes
  warning: 2.1.5-compliant syntax, but you are running 2.1.3.
  
  ...
  
    1) Error:
  AccountControllerTest#test_activate_api_key:
  NoMethodError: undefined method `before_filter' for AccountController:Class
      app/controllers/account_controller.rb:47:in `&lt;class:AccountController&gt;'
      app/controllers/account_controller.rb:46:in `&lt;top (required)&gt;'
  
    2) Error:
  AccountControllerTest#test_add_mugshot:
  RuntimeError: @controller is nil: make sure you set it in your test's setup method.
      test/functional_test_case.rb:26:in `post'
      test/controller_extensions.rb:533:in `assert_request'
      test/controller_extensions.rb:202:in `either_requires_either'
      test/controller_extensions.rb:137:in `post_requires_login'
      test/controllers/account_controller_test.rb:418:in `test_add_mugshot'
  </code></pre>
  
  <p>Account Controller definition:</p>
  
  <pre><code>class AccountController &lt; ApplicationController
    before_filter :login_required, :except =&gt; [
  </code></pre>
  
  <p>Application Controller:</p>
  
  <pre><code>class ApplicationController &lt; ActionController::Base
  </code></pre>