Created
November 23, 2013 19:30
-
-
Save jameshwang/7618874 to your computer and use it in GitHub Desktop.
Example of a subscription_change_presenter but with a better name
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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