Module: Spreedly
- Defined in:
- lib/spreedly/subscriptions.rb,
lib/spreedly/subscriptions/mock.rb,
lib/spreedly/subscriptions/common.rb,
lib/spreedly/subscriptions/version.rb,
lib/spreedly/subscriptions/test_hacks.rb
Overview
Provides a convenient wrapper around the spreedly.com/info/integration API. Instead of mucking around with http you can just Spreedly::Subscriptions.configure and Spreedly::Subscriber.find. Much of the functionality is hung off of the Spreedly::Subscriptions::Subscriber class, and there’s also a Spreedly::SubscriptionPlan class.
One of the goals of this wrapper is to keep your tests fast while also keeping your app working. It does this by providing a drop-in replacement for the real Spreedly functionality that skips the network and gives you a simple (some might call it stupid) implementation that will work for 90% of your tests. At least we hope so.
Help us make the mock work better by telling us when it doesn’t work so we can improve it. Thanks!
Example mock usage:
if ENV["SPREEDLY"] == "REAL"
require 'spreedly/subscriptions'
else
require 'spreedly/subscriptions/mock'
end
Defined Under Namespace
Modules: Subscriptions