Redirect_to sign in page if AJAX call is not authorized
问题 I have a form and when you click submit it will make an AJAX call to update the thing you want to change. My user session expires in 4 hours, so if the user wants to update the form and his session has expired in the meantime it will render a flash message asking to reload the page and sign in again. When trying to test this behavior using Cucumber , Capybara , Selenium and Chrome the AJAX response is never received as the flash message is not rendered. (If I test it manually it works just