title: Capybara::InfiniteRedirectError - by click_link in rails 3.2.12 integration test
body: <p>Here is a piece of code in rails integration test with capybara:</p>
  
  <pre><code>it "should work with links on index page" do
        visit customers_path
        save_and_open_page
        click_link 'Edit'
  end
  </code></pre>
  
  <p>The html page displayed is:</p>
  
  <p><img src="https://i.stack.imgur.com/u4a4D.jpg" alt="enter image description here"></p>
  
  <p>There is a Edit link in the page. However click_link 'Edit' still throws out the error:</p>
  
  <pre><code> 1) TestPaths GET /customerx_test_paths should work with links on index page
       ←[31mFailure/Error:←[0m ←[31mclick_link 'Edit'←[0m
       ←[31mCapybara::InfiniteRedirectError:←[0m
         ←[31mredirected more than 5 times, check for infinite redirects.←[0m
  ←[36m     # ./spec/features/customerx/customerx_test_paths_spec.rb:130:in `block (3 levels) in &lt;top (required)&gt;'←[0m
  </code></pre>
  
  <p>The integration test for edit customer passes. But every click_link in the test gives us the error. What could be wrong with the code? Thanks.</p>