From bfa55163eac6ebeb8fd5d09f6303f158fd614fef Mon Sep 17 00:00:00 2001 From: John Firebaugh Date: Sun, 26 May 2013 23:39:29 -0700 Subject: [PATCH] Suppress JS errors in Poltergeist This should be handled by visionmedia/mocha#868, but PhantomJS probably still has a version of WebKit with https://bugs.webkit.org/show_bug.cgi?id=67119 --- spec/spec_helper.rb | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index 041383d..e729c65 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -21,6 +21,13 @@ config.app = Konacha.application end +Capybara.register_driver :poltergeist do |app| + # Work around a bug in PhantomJS where `return true` from a + # window.onerror handler does not prevent an uncaught exception + # from being reported to Ruby. + Capybara::Poltergeist::Driver.new(app, :js_errors => false) +end + module Konacha module FeatureSpec def app