I am running into errors testing my Braintree sandbox payments using Rspec, Capybara, and Poltergeist in a feature test. I have it set up to do exactly what a human would do in development (entering payment info and clicking submit). It works fine in development. However, when I run my spec, I get a javascript error on the payment page when it loads:
Capybara::Poltergeist::JavascriptError:
One or more errors were raised in the Javascript code on the page. If you don't care about these errors, you can ignore them by setting js_errors: false in your Poltergeist configuration (see documentation for details).
[object Object]
[object Object]
at https://js.braintreegateway.com/js/braintree-2.24.0.js:9484 in fallbackError
# /usr/local/bundle/gems/poltergeist-1.10.0/lib/capybara/poltergeist/browser.rb:365:in `command'
# /usr/local/bundle/gems/poltergeist-1.10.0/lib/capybara/poltergeist/browser.rb:181:in `click'
# /usr/local/bundle/gems/poltergeist-1.10.0/lib/capybara/poltergeist/node.rb:17:in `command'
# /usr/local/bundle/gems/poltergeist-1.10.0/lib/capybara/poltergeist/node.rb:131:in `click'
Has anyone run into a similar issue or have any idea why Braintree's js might be throwing this error in testing (headless browser) when it works fine in development?