Basically, this is what I did:
Include in the Gemfile:
Update Capybara configuration:
And run the specs!
undefined method `switch_to'
I tried to fix it and find out that Poltergeist always returns true for a call to window.confirm. There’s no way to make it return false (at the moment), but it should not prevent your test from running.
So, I just removed that line and it works!
Before: Finished in 1 minute 35.45 seconds After: Finished in 41.03 seconds