How can I do the following without using any_instance from Mocha? I just want to test a protected Controller as described here without using Rspec.
class PortfoliosControllerTest < ActionController::TestCase
setup do
@portfolio = portfolios(:p2)
user = @portfolio.user
token = Doorkeeper::AccessToken.create!(application_id: 'minitest',
resource_owner_id: user.id)
PortfoliosController.any_instance.stubs(:doorkeeper_token).returns(token)
end
end