Skip to content

Instantly share code, notes, and snippets.

@jameshwang
Created November 23, 2013 19:30
Show Gist options
  • Save jameshwang/7618874 to your computer and use it in GitHub Desktop.
Save jameshwang/7618874 to your computer and use it in GitHub Desktop.
Example of a subscription_change_presenter but with a better name
require 'subscription_change_controller'
describe SubscriptionChangeController do
let(:account) { double('account', update_subscription: true) }
let(:finance) { double('finance', notify: true) }
let(:sales) { double('sales', notify: true) }
it "updates the account" do
expect(account).to receive(:update_subscription)
SubscriptionChangeController.new(account).run
end
it "notifies finance -> generate invoice, handle payment" do
expect(finance).to receive(:notify)
SubscriptionChangeController.new(account, finance, sales).run
end
it "notifies sales -> gong, revenue change, and sfdc" do
expect(sales).to receive(:notify)
SubscriptionChangeController.new(account, finance, sales).run
end
it "notifies the the customer with an email"
it "notifies partners"
it "copies the attributes of the old subscription to the new one"
it "updates the attributes of the new subscription"
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment