title: Rspec redirect_to follow multiple redirects
body: <p>I am trying to write a test to make sure users are redirected to the proper page after signing in. The problem however is that the user goes through two redirects before arriving at the page I want to check. Currently using <code>expect(subject).to redirect_to(accounts_plan_page)</code> stops the redirect chain at the first redirect and does not continue to the last page. So the login flow goes <code>localhost/signin -&gt; localhost/ -&gt; localhost/account/plan</code>. I want to test if the user gets to <code>/account/plan</code> but redirect_to stops at the root path. Is there anyway to have rspec follow to the final redirect instead of ending at the first one?</p>
  
  <p>abbreviated login_spec:</p>
  
  <pre><code>describe 'login', type: :request do
    let(:user) { FactoryGirl.create(:user) }
    subject { post '/signin', { user: { email: user.email, password: user.password } } }
  
    it 'redirects a user properly' do
      accounts_plan_page = 'http://127.0.0.1:3000/account/plan'
      if user.account.requires_metered?
        expect(subject).to redirect_to(account_plans_page)
      end
    end
  end
  </code></pre>
  
  <p>This returns something along the lines of </p>
  
  <pre><code>Expected response to be a redirect to &lt;http://127.0.0.1:3000/account/plan&gt; but was a redirect to &lt;http://127.0.0.1:3000/&gt;
  </code></pre>