title: Rails Minitest Stub Class method called inside controller
body: <p>How can I stub a method that is called inside a controller when simulating a request?</p>
  
  <p>What I've tryied:</p>
  
  <pre><code>require 'test_helper'
  class ConfirmationsControllerTest &lt; ActionController::TestCase
    test 'dummy test' do
      User.stub(:some_method, 'string') do
        p User.some_method
        get(:index)
      end
    end
  end
  
  class ConfirmationsController &lt; ApplicationController
    def index
      p User.some_method
    end
  end
  </code></pre>
  
  <p>When I print <code>User.some_method</code> inside the stub it works, but when I use the method inside my controller action it doesn't.</p>