Mocking an external API
问题 I'm new to testing strategies and mocking, and I'm having a tough time figuring out how to mock a call to an external service. I'm sure it's something easy I'm missing, I just don't know what exactly. I'm using the Braintree gem to charge for subscription services through the Braintree gateway, and I wanted to mock the Customer create method and Subscription create method in my UserController's create method. A Customer.create method looks something like this: result = Braintree::Customer