Skip to content

Commit

Permalink
Cleanup.
Browse files Browse the repository at this point in the history
  • Loading branch information
Gabe Berke-Williams committed Nov 18, 2011
1 parent 3d758a1 commit 1811656
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions spec/fake_braintree/subscription_spec.rb
Expand Up @@ -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)
Expand All @@ -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
Expand Down

0 comments on commit 1811656

Please sign in to comment.