While testing a feature that requires a confirmation, you may have seen a: Selenium::WebDriver::Error::UnhandledAlertError error.

There are two different ways to accept the confirm alert in an acceptance/feature spec:

  1. Access driver itself, sometime after the dialog is expected to appear:
  1. Wrap your click event in an accept_confirm method:
page.accept_confirm do

Hopefully this helps, Happy coding!