Skip to content

Instantly share code, notes, and snippets.

@jsqu99
Created June 11, 2015 16:07
Show Gist options
  • Save jsqu99/e14a7e46e95f2fcebc22 to your computer and use it in GitHub Desktop.
Save jsqu99/e14a7e46e95f2fcebc22 to your computer and use it in GitHub Desktop.
require 'spec_helper'
describe SubscriptionCancel do
let(:subscription) { double("Subscription") }
let(:remote_subscription) { double("Local::Chargify::Subscription") }
subject {
SubscriptionCancel.new(1, ->(x) {subscription})
}
before do
AppConfig.remote_subscription_fetcher= OpenStruct.new(find_by_id: remote_subscription)
end
it "cancels immediately" do
expect (subscription).to receive(:update_attributes)
subject.cancel_immediately
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment