Skip to content

Commit

Permalink
Set amount when generating a transaction.
Browse files Browse the repository at this point in the history
  • Loading branch information
Gabe Berke-Williams committed Feb 3, 2012
1 parent 0a45900 commit 783719c
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lib/fake_braintree.rb
Expand Up @@ -88,7 +88,8 @@ def self.generate_transaction(options = {})
created_at = options[:created_at] || Time.now
{'status_history' => [history_item],
'subscription_id' => options[:subscription_id],
'created_at' => created_at }
'created_at' => created_at,
'amount' => options[:amount] }
end

private
Expand Down
5 changes: 5 additions & 0 deletions spec/fake_braintree_spec.rb
Expand Up @@ -107,6 +107,11 @@ def write_to_log
end
end

it "has the correct amount" do
transaction = FakeBraintree.generate_transaction(:amount => "20.00")
transaction['amount'].should == "20.00"
end

it "allows no arguments" do
expect { FakeBraintree.generate_transaction }.not_to raise_error
end
Expand Down

0 comments on commit 783719c

Please sign in to comment.