title: assert_redirected_to in Rails Testing
body: <p>I am trying to run some tests on my Customers controller. When I manually test the controller, all is working fine, however when I do written Integration tests on it, I get an error. Here is my Test code:</p>
  
  <pre><code>context "non-empty Customer model" do
    setup do
      @customer = Customer.first || Customer.create(:name =&gt; "John", :address =&gt; "123 Street Cool", :telephone =&gt; "01484349361", :email =&gt; "johnsmith@world.com")
    end
  
    should "be able to create" do
      get "/customers/new"
      assert_response :success
      post "/customers/create", :post =&gt; @customer
      # assert_response :success
      assert_redirected_to "/customers/list"
    end
  </code></pre>
  
  <p>And the error I am getting is on the assert_redirected_to line and it says:</p>
  
  <blockquote>
    <p>Expected block to return true value.</p>
  </blockquote>
  
  <p>Here is my controller code the for new/create actions:</p>
  
  <pre><code>  def new
      @customer = Customer.new
  
      respond_to do |format|
        format.html # new.html.erb
        format.xml  { render :xml =&gt; @customer }
      end
    end
  
    def create
      # Instantiate a new object using form params
      @customer = Customer.new(params[:customer])
      # Save the object
      if @customer.save
        # If save succeeds, redirect to the list action
        flash[:notice] = "Customer created."
        redirect_to(:action =&gt; 'list')
      else
        # If save fails, redisplay the form so user can fix problems
        render('new')
      end
    end
  </code></pre>
  
  <p>How can I get the tests working?</p>