spec/unit/braintree/transaction_spec.rb in braintree-2.76.0 vs spec/unit/braintree/transaction_spec.rb in braintree-2.77.0
- old
+ new
@@ -207,9 +207,26 @@
transaction.status_history[0].transaction_source.should == "API"
transaction.status_history[0].timestamp.should == time
transaction.status_history[1].user.should == "curly"
end
+ it "sets up authorization_adjustments" do
+ timestamp = Time.utc(2010,1,14)
+ transaction = Braintree::Transaction._new(
+ :gateway,
+ :authorization_adjustments => [
+ { :timestamp => timestamp, :amount => "12.00", :success => true },
+ { :timestamp => timestamp, :amount => "12.34", :success => false },
+ ])
+ transaction.authorization_adjustments.size.should == 2
+ transaction.authorization_adjustments[0].amount.should == "12.00"
+ transaction.authorization_adjustments[0].success.should == true
+ transaction.authorization_adjustments[0].timestamp.should == timestamp
+ transaction.authorization_adjustments[1].amount.should == "12.34"
+ transaction.authorization_adjustments[1].success.should == false
+ transaction.authorization_adjustments[1].timestamp.should == timestamp
+ end
+
it "handles receiving custom as an empty string" do
transaction = Braintree::Transaction._new(
:gateway,
:custom => "\n "
)