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 20, 2011
1 parent 4cb5cb0 commit 4fc470d
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions spec/fake_braintree_spec.rb
Expand Up @@ -107,11 +107,16 @@ def write_to_log
end

describe FakeBraintree, ".generate_transaction" do
it "returns a hash with a status_history key" do
FakeBraintree.generate_transaction(:amount => '20').should have_key('status_history')
it "includes the subscription id" do
transaction = FakeBraintree.generate_transaction(:subscription_id => 'foobar')
transaction['subscription_id'].should == 'foobar'
end

context "status_history" do
it "returns a hash with a status_history key" do
FakeBraintree.generate_transaction(:amount => '20').should have_key('status_history')
end

it "has a timestamp of Time.now" do
Timecop.freeze do
transaction = FakeBraintree.generate_transaction(:status => Braintree::Transaction::Status::Failed,
Expand All @@ -130,10 +135,5 @@ def write_to_log
transaction = FakeBraintree.generate_transaction(:status => status)
transaction['status_history'][0]['status'].should == status
end

it "includes the subscription id" do
transaction = FakeBraintree.generate_transaction(:subscription_id => 'foobar')
transaction['subscription_id'].should == 'foobar'
end
end
end

0 comments on commit 4fc470d

Please sign in to comment.