You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm trying to test my controller code that would happen if a user tried to create a subscription with an existing card, but that fails (fraud, not enough funds, etc).
I don't see any example of how I could make Braintree::Subscription.create fail. Calling FakeBraintree.decline_all_cards! doesn't seem to have any effect on creating a subscription with an existing card.
I'm thinking I could just mock it? Is that possible? Or does anyone have any advice for this situation?
In other words, I'm looking for a way for the result returned by Braintree::Subscription.create() to not be success so I can test that my controller does what it is supposed to do in that case.
The text was updated successfully, but these errors were encountered:
I'm trying to test my controller code that would happen if a user tried to create a subscription with an existing card, but that fails (fraud, not enough funds, etc).
I'm checking out the specs for subscriptions here: https://github.com/highfidelity/fake_braintree/blob/master/spec/fake_braintree/subscription_spec.rb
I don't see any example of how I could make Braintree::Subscription.create fail. Calling FakeBraintree.decline_all_cards! doesn't seem to have any effect on creating a subscription with an existing card.
I'm thinking I could just mock it? Is that possible? Or does anyone have any advice for this situation?
In other words, I'm looking for a way for the result returned by Braintree::Subscription.create() to not be success so I can test that my controller does what it is supposed to do in that case.
The text was updated successfully, but these errors were encountered: