spec/integration/braintree/transaction_spec.rb in braintree-2.32.1 vs spec/integration/braintree/transaction_spec.rb in braintree-2.33.0
- old
+ new
@@ -899,16 +899,18 @@
:number => Braintree::Test::CreditCardNumbers::Visa,
:expiration_date => "05/2009"
},
:descriptor => {
:name => '123*123456789012345678',
- :phone => '3334445555'
+ :phone => '3334445555',
+ :url => "ebay.com"
}
)
result.success?.should == true
result.transaction.descriptor.name.should == '123*123456789012345678'
result.transaction.descriptor.phone.should == '3334445555'
+ result.transaction.descriptor.url.should == 'ebay.com'
end
it "has validation errors if format is invalid" do
result = Braintree::Transaction.sale(
:amount => Braintree::Test::TransactionAmounts::Authorize,
@@ -916,16 +918,18 @@
:number => Braintree::Test::CreditCardNumbers::Visa,
:expiration_date => "05/2009"
},
:descriptor => {
:name => 'badcompanyname12*badproduct12',
- :phone => '%bad4445555'
+ :phone => '%bad4445555',
+ :url => '12345678901234'
}
)
result.success?.should == false
result.errors.for(:transaction).for(:descriptor).on(:name)[0].code.should == Braintree::ErrorCodes::Descriptor::NameFormatIsInvalid
result.errors.for(:transaction).for(:descriptor).on(:phone)[0].code.should == Braintree::ErrorCodes::Descriptor::PhoneFormatIsInvalid
+ result.errors.for(:transaction).for(:descriptor).on(:url)[0].code.should == Braintree::ErrorCodes::Descriptor::UrlFormatIsInvalid
end
end
context "level 2 fields" do
it "accepts tax_amount, tax_exempt, and purchase_order_number" do
@@ -2648,9 +2652,11 @@
dispute.reply_by_date.should == Date.new(2014, 3, 21)
dispute.amount.should == Braintree::Util.to_big_decimal("250.00")
dispute.currency_iso_code.should == "USD"
dispute.reason.should == Braintree::Dispute::Reason::Fraud
dispute.status.should == Braintree::Dispute::Status::Won
+ dispute.transaction_details.amount.should == Braintree::Util.to_big_decimal("1000.00")
+ dispute.transaction_details.id.should == "disputedtransaction"
end
it "is not disputed" do
result = Braintree::Transaction.create(
:type => "sale",