title: How to do integration testing in Rails 3?
body: <p>I tried using the code in the RailsGuides and some other code I found on Google, but nothing is working. </p>
  
  <p>How do you do a simple integration test in Rails 3 using Test::Unit? How do you make the session persist across http requests?</p>
  
  <p>The following code fails because <code>Expected response to be a &lt;:success&gt;, but was &lt;302&gt;</code>. I think it is because the session is lost after the post request.</p>
  
  <pre><code>class UserFlowsTest &lt; ActionDispatch::IntegrationTest
    fixtures :all
  
    test "client can get client dashboard" do
      post '/login', :login=&gt; users(:client).login, :password =&gt; 'thepassword' 
      get '/dash'    
      assert_response :success    
    end
  
  end
  </code></pre>
  
  <p>Working in Rails 3.07.</p>
  
  <p>Thanks.</p>