RSpec tests not loading Stripe card element - works correctly live/locally

105 Views Asked by At

I think this is down to my lack of experience with RSpec but its driving me crazy - the stripe card element isn't generating on the screen so the test fails with a js error due to Stripe not working/having the actual fields available.

I've tracked it down to the javascript include https://js.stripe.com/v3/ in the header being a localhost url instead during the test, so I'm assuming that's the reason for stripe not loading correctly. I've tried stubbing the stripe url but the localhost url still comes up - using selenium, web mock etc. Not using stripe-ruby-mock if that makes any difference.

Anyone clues how I get the include to be the stripe url?

Thanks :)

0

There are 0 best solutions below