Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Cleanup.

  • Loading branch information...
commit 181165635e7be2489ee8d384684dfca539ede3e7 1 parent 3d758a1
@gabebw gabebw authored
Showing with 8 additions and 8 deletions.
  1. +8 −8 spec/fake_braintree/subscription_spec.rb
View
16 spec/fake_braintree/subscription_spec.rb
@@ -5,18 +5,14 @@
let(:expiration_date) { "04/2016" }
it "successfully creates a subscription" do
- result = Braintree::Subscription.create(:payment_method_token => cc_token,
- :plan_id => plan_id)
- result.should be_success
+ create_subscription.should be_success
end
it "assigns a Braintree-esque ID to the subscription" do
- result = Braintree::Subscription.create(:payment_method_token => cc_token,
- :plan_id => plan_id)
-
- result.subscription.id.should =~ /^[a-z0-9]{6}$/
+ create_subscription.subscription.id.should =~ /^[a-z0-9]{6}$/
end
+
it "assigns unique IDs to each subscription" do
cc_token_1 = cc_token
cc_token_2 = braintree_credit_card_token(TEST_CC_NUMBER.sub('1', '5'), expiration_date)
@@ -36,10 +32,14 @@
result.subscription.next_billing_date.to_i.should == 1.month.from_now.utc.to_i
end
end
+
+ def create_subscription
+ Braintree::Subscription.create(:payment_method_token => cc_token,
+ :plan_id => plan_id)
+ end
end
describe "Braintree::Subscription.find" do
-
it "can find a created subscription" do
subscription = Braintree::Subscription.find(subscription_id)
subscription.should_not be_nil
Please sign in to comment.
Something went wrong with that request. Please try again.