title: How can I set http header for all capybara features
body: <p>I use rspec, capybara. I set locale from http header as in bellow</p>
  
  <pre><code>  before_filter :set_locale
  
    def extract_locale_from_accept_language_header
      request.env['HTTP_ACCEPT_LANGUAGE'].scan(/^[a-z]{2}/).first
    end
  
    def set_locale
      return I18n.locale = current_user.locale if user_signed_in?
      I18n.locale = extract_locale_from_accept_language_header || I18n.default_locale
    end
  </code></pre>
  
  <p>When I run my feature test I get error 'undefined method <code>scan</code> for NilClass'. 
  Apparently capybara don't set http headers. </p>
  
  <p>How I can set http header for all my features or avoid this by another way?</p>