I\'m trying to test a JS confirmation dialog with Cucumber on Rails. I have a window.onbeforeunload event handler that will prompt you with a confirmation dialog if you try to n
This gist has steps to test a JS confirm dialog in Rails 2 and 3 with any Capybara driver, should be easy to adapt to an alert box.