title: Rails - minitest - Testing pages that require login
body: <p>I am working on tests but running in to a road block on pages that require a current_user.  I am using minitest, capybara, factorygirl, and authlogic, in rails 3.2.9 with ruby 1.9.3p327.  I installed minitest as a separate gem, and seem to have the test environment working correctly.  </p>
  
  <p>I have a factory that creates a valid user...I call that factory from in a test like this:</p>
  
  <pre><code>  describe "UsersAcceptanceTest" do
      it "must load and include content" do
        FactoryGirl.create(:user)
        visit users_path
        page.must_have_content("cPanel")
      end
    end
  </code></pre>
  
  <p>The FAIL is correct in informing me that the content "cPanel" was not found (cPanel is a link available to logged in users).  The fail error goes on to alert me that it was not found in "log in, forgot password, contact" ... which of course means that the test routed correctly to users_path, but was redirected by authlogic because the user is not logged in. Users cant create themselves in my system and therefor are not auto-logged in on create.</p>
  
  <p>How to I also get the factory to create a new user session with the newly created user?</p>