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
I would recommend using screw-unit for testing javascript behavior on a page. You can also take a look at Relevance's blue-ridge plugin which incorporates screw-unit and adds support for command line and in browser js testing. You can find it on github under relevance/blue-ridge. (I don't have the rep yet to post more than one link :(
It would be an interesting exercise to use screw-unit and/or blue-ridge to drive cucumber tests, and probably not that hard to pull off.