I have a page that contains a form. Upon submitting the form, it triggers an AJAX call to the server. If the call is successful, the page is then redirected to a new URL using JavaScript:
$('form').bind('ajax:success', function(){
window.location = redirect_url;
});
Now, I am trying to figure out how to test this redirect functionality using Capybara. My setup involves Selenium as the webdriver for Capybara. While filling out and submitting the form is straightforward, I'm unsure about how to properly test this combination of AJAX and redirection.
It appears that the wait_until
method has been removed in Capybara 2 (source: ), which adds to my confusion regarding how to verify this redirect behavior.
Your insights or suggestions on this matter would be greatly appreciated. Thank you!