I'm having some trouble testing a Braintree rails app using fake_braintree. I'm not using rspec, and maybe that is part of the problem.
In my tests, I interact with FakeBraintree---adding customers there, etc... But in the non-test code, I pull data from the Braintree API itself. Thus, when my tests hits the non-tests code, the code connects to the Braintree Sandbox, but (of course) the customer created via FakeBraintree is not there. It doesn't seem to me that I want to do anything atypical, and I'm unclear how I should be using fake_braintree, and having trouble finding clear documentation. Maybe the problem is trying to do this without using rspec?
thanks!
I came back to this after some time, and the solution was surprising (or to me at least). If the test environment has access to the Braintree sandbox, then it connects there rather than fake_braintree. So in order to get the tests with fake_braintree to work, I had to reconfigure my configurations so that the braintree configuration variables were not set for the test environment.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With