title: Maintaining Session with Capybara and Rails 3
body: <p>I have two capybara tests, the first of which signs in a user, and the second which is intended to test functions only available to a logged in user.</p>
  
  <p>However, I am not able to get the second test working as the session is not being maintained across tests (as, apparently, it should be).</p>
  
  <pre><code>require 'integration_test_helper'
  
  class SignupTest &lt; ActionController::IntegrationTest
  
    test 'sign up' do  
      visit '/'
      click_link 'Sign Up!'
      fill_in 'Email', :with =&gt; 'bob@wagonlabs.com'
      click_button 'Sign up'
      assert page.has_content?("Password can't be blank")
      fill_in 'Email', :with =&gt; 'bob@wagonlabs.com'
      fill_in 'Password', :with =&gt; 'password'
      fill_in 'Password confirmation', :with =&gt; 'password'
      click_button 'Sign up'
      assert page.has_content?("You have signed up successfully.")
    end
  
    test 'create a product' do
      visit '/admin'
      save_and_open_page
    end
  
  end
  </code></pre>
  
  <p>The page generated by the save_and_open_page call is the global login screen, not the admin homepage as I would expect (the signup logs you in).  What am I doing wrong here?</p>