title: Rails: Wrong hostname for url helpers in rspec
body: <p>Url helpers (e.g root_url) returns a different hostname in the app controllers vs rspec examples.
  I have successfully been able to set the domain for url helpers in my rails app like this:</p>
  
  <pre><code>class ApplicationController &lt; ActionController::Base
    def default_url_options
      {host: "foo.com", only_path: false}
    end
  end
  </code></pre>
  
  <p>For example, root_url outputs "http://foo.com/" within the application but "http://example.com" in my request specs. What is the recommended way to apply those url options globally in rails 3.2 so that they affect my specs?
  The url options do not need to be dynamic.</p>