Context: an application uses a piece of Rack middleware that must be setup in config.ru, rather than Rails's internal Middleware chain. This is for reasons not relevant to this question. Question: how do I make my tests (functional and integration) aware of this middleware? I'll ellaborate with an example. Let's create a pristine Rails 3 app, using rack-rewrite for illustration purposes. # /config