I have the following in my scenario:
And I click the link Log out
Then I should see the login page
Clicking the Log out link sends the user to /log_out, which redirects back to the log in page. Webrat is failing because it's looking for "Login" but the log_out page is empty (it's just a codeigniter function which destroys the session and redirects to /)
What is the best way of making webrat realise that it needs to read the page at the end of the redirect?
A simple but inefficient way would be to just add a sleep for the approximate time it would take to perform the redirect.
Step definition
However this solution is very brittle when it comes to network lag, your wait could either be too long or too short. A better way would be to sleep until the content you're looking for appears.
Step definition
If you find yourself using the wait for other steps, the rest of the step after the comma could be generalized.