title: How do I change the default "www.example.com" domain for testing in rails?
body: <p>I have a rails application which acts differently depending on what domain it's accessed at (for example www.myapp.com will invoke differently to user.myapp.com). In production use this all works fine but my test code always sees a hostname of "www.example.com".</p>
  
  <p>Is there a clean way of having a test specify the hostname it's pretending to access?</p>