How to use fake_braintree for testing a rails app given that non-test code hits the actual Braintree API -
i'm having trouble testing braintree rails app using fake_braintree. i'm not using rspec, , maybe part of problem.
in tests, interact fakebraintree---adding customers there, etc... in non-test code, pull data braintree api itself. thus, when tests hits non-tests code, code connects braintree sandbox, (of course) customer created via fakebraintree not there. doesn't seem me want atypical, , i'm unclear how should using fake_braintree, , having trouble finding clear documentation. maybe problem trying without using rspec?
thanks!
i came after time, , solution surprising (or me @ least). if test environment has access braintree sandbox, connects there rather fake_braintree. in order tests fake_braintree work, had reconfigure configurations braintree configuration variables not set test environment.
Comments
Post a Comment