Waiting for an element to disappear 06/08/2012
# Wait while the element, in this case a link, is present on the page.
# The timeout is by default 30 seconds.
browser.link(:id => '<link_id>').wait_while_present

Sometimes it is useful to wait until an element disappears from the page. That can be achieved with the code above.