title: Rails/Rspec Make tests pass with http basic authentication
body: <p>Here my http basic authentication in the application controller file (application_controller.rb)</p>
  
  <pre><code>before_filter :authenticate
  
  protected
  
  def authenticate
    authenticate_or_request_with_http_basic do |username, password|
      username == "username" &amp;&amp; password == "password"  
    end
  end
  </code></pre>
  
  <p>and the default test for the index action of my home controller (spec/controllers/home_controller_spec.rb)</p>
  
  <pre><code>require 'spec_helper'
  
  describe HomeController do
  
  describe "GET 'index'" do
    it "should be successful" do
      get 'index'
      response.should be_success
    end
  end
  </code></pre>
  
  <p>Test doesn't run because of the authentication method. I could comment "before_filter :authenticate" to run them but I would like to know if there is way to make them worked with the method.</p>
  
  <p>Thank you!</p>