Permalink
Browse files

Set amount when generating a transaction.

  • Loading branch information...
1 parent 0a45900 commit 783719c655935eca6f4904f3ac498ed9f0ad98b1 @gabebw gabebw committed Feb 3, 2012
Showing with 7 additions and 1 deletion.
  1. +2 −1 lib/fake_braintree.rb
  2. +5 −0 spec/fake_braintree_spec.rb
View
@@ -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
@@ -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

0 comments on commit 783719c

Please sign in to comment.