title: How can I test only a part of the URL I am redirected to (using assert_redirected_to)?
body: <p>In a functional test of my Rails app, I want to test where I am redirected to. The expected URL points to an external resource (that means it's not part of my application).</p>
  
  <p>The URL looks like this: <code>https://my.url.com/foo?bar1=xyz&amp;bar2=123</code></p>
  
  <p>Unfortunately I can't predict the parameters, because they are generated by an external resource.*<br>
  However, the rest of the URL always stays the same: <code>https://my.url.com/foo</code></p>
  
  <p>I usually use <code>assert_redirected_to</code> for this kind of test, but this expects the whole URL, including the parameters.</p>
  
  <p>Can anyone think of another way to test that redirection but only check for the first part of the URL without the parameters?</p>
  
  <p>(the URL is not in the <code>assigns</code> Hash)</p>
  
  <p>*(I make an API call to an application, which responses with the URL I shall redirect_to)</p>