title: Rails: Moving a helper method form a test to test_helper.rb
body: <p>I am trying to move a helper method from a controller test to the test_helper.rb:</p>
  
  <pre><code># example_controller_test.rb
  require 'test_helper'
  class ExampleControllerTest &lt; ActionController::TestCase
    should 'get index' do
      turn_off_authorization
      get :show
      assert_response :success
    end
  end
  
  # test_helper.rb
  class ActionController::TestCase
    def turn_off_authorization
      ApplicationController.any_instance
                           .expects(:authorize_action!)
                           .returns(true)
    end
  end
  </code></pre>
  
  <p>However, I'm getting an error:</p>
  
  <pre><code>NameError: undefined local variable or method `turn_off_authorization' for #&lt;ExampleControllerTest:0x000000067d6080&gt;
  </code></pre>
  
  <p>What am I doing wrong?</p>