Skip to content

Instantly share code, notes, and snippets.

/gist:672bf704fd7ae3aec989 Secret

Created Jul 24, 2013
Embed
What would you like to do?
describe "#create_stripe_customer" do
before do
@subscription = build(:subscription, user: user)
@subscription.create_stripe_customer
@subscription.save
@stripe_customer = Stripe::Customer.retrieve @subscription.stripe_customer_token
end
context "the subscription record" do
subject { @subscription }
it "has a stripe customer token", vcr: {match_requests_on: [:method, :uri]} do
subject.stripe_customer_token.should_not be_blank
end
end
context "stripe customer record" do
subject { @stripe_customer }
it "has a description", vcr: {match_requests_on: [:method, :uri]} do
subject.description.should == user.id.to_s
end
it "has an email", vcr: {match_requests_on: [:method, :uri]} do
subject.email.should == user.email
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment