title: Testing login with Capybara / Rspec
body: <p>I am having some difficulty in testing my login procedure.  Currently, I have the following request spec:</p>
  
  <pre><code>     describe "GET /admins" do
          before(:each) do
            @admin = Factory.create(:user, :winery =&gt; nil, :email =&gt; 'admin@example.com', :admin =&gt; true)
            @attr = { :email =&gt; @admin.email, :password =&gt; @admin.password }
          end
  
  
      it "should log admin users in" do
        visit admin_path
        post_via_redirect admin_path, :session =&gt; @attr
        save_and_open_page
        page.should have_content('Admin Dashboard')
      end
    end
  </code></pre>
  
  <p>This is failing, and the save_and_open_page, just shows my login page (I can log in normally to my development site, so the actual code works).  I have also tried writing the spec using Capybara to fill in the form and click the log in button, with the same failure. I have been able to write a passing spec in Cucumber, but only with selenium.</p>
  
  <p>using:
  Capybara (0.4.1.2)
  Rspec (2.5.0)
  rspec-rails (2.5.0)
  rails (3.0.5)</p>
  
  <p>thanks </p>