title: How to set locale default_url_options for functional tests (Rails)
body: <p>In my application_controller, I have the following set to include the locale with all paths generated by url_for:</p>
  
  <pre><code>  def default_url_options(options={})
      { :locale =&gt; I18n.locale }
    end
  </code></pre>
  
  <p>My resource routes then have a :path_prefix = "/:locale"</p>
  
  <p>Works fine on the site.</p>
  
  <p>But when it comes to my functional tests, the :locale is not passed with the generated urls, and therefore they all fail. I can get around it by adding the locale to the url in my tests, like so:</p>
  
  <pre><code>  get :new, :locale =&gt; 'en'
  </code></pre>
  
  <p>But I don't want to have to manually add the locale to every functional test. </p>
  
  <p>I tried adding the default_url_options def above to test_helper, but it seems to have no effect.</p>
  
  <p>Is there any way I can change the default_url_options to include the locale for all my tests?</p>
  
  <p>Thanks.</p>