Routing all requests to Rails via WebMock during tests

WebMock allows you to route all HTTP requests made during tests to a rack app with to_rack. You can use this method to route the same traffic to a Rails app as well.

stub_request(:any, /  

Rails.application is the rack object in a Rails app.