Skip to content

Commit

Permalink
Suppress JS errors in Poltergeist
Browse files Browse the repository at this point in the history
This should be handled by mochajs/mocha#868, but
PhantomJS probably still has a version of WebKit with
https://bugs.webkit.org/show_bug.cgi?id=67119
  • Loading branch information
jfirebaugh committed May 27, 2013
1 parent 40f398f commit bfa5516
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions spec/spec_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit bfa5516

Please sign in to comment.