If you are testing some confirm() javascript method and you have a code similar to page.driver.browser.switch_to.alert.accept, you’ll got this error:

undefined method `switch_to'

While I was trying to fix it, I find out that Poltergeist always returns true from window.confirm. There’s no way (at the moment) to make it return false, but it should not prevent your test from running.