diff --git a/lib/fake_braintree.rb b/lib/fake_braintree.rb index 6efdc58..c12d7ba 100644 --- a/lib/fake_braintree.rb +++ b/lib/fake_braintree.rb @@ -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 diff --git a/spec/fake_braintree_spec.rb b/spec/fake_braintree_spec.rb index 0e25340..7224b32 100644 --- a/spec/fake_braintree_spec.rb +++ b/spec/fake_braintree_spec.rb @@ -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