spec/integration/braintree/customer_spec.rb in braintree-3.4.0 vs spec/integration/braintree/customer_spec.rb in braintree-4.0.0
- old
+ new
@@ -38,10 +38,11 @@
:company => "Microsoft",
:email => "bill@microsoft.com",
:phone => "312.555.1234",
:fax => "614.555.5678",
:website => "www.microsoft.com",
+ :tax_identifiers => [{:country_code => "US", :identifier => "987654321"}],
)
result.success?.should == true
result.customer.id.should =~ /^\d{6,}$/
result.customer.first_name.should == "Bill"
result.customer.last_name.should == "Gates"
@@ -112,10 +113,21 @@
)
result.should be_success
end
+ it "supports creation with tax_identifiers" do
+ result = Braintree::Customer.create(
+ :tax_identifiers => [
+ {:country_code => "US", :identifier => "987654321"},
+ {:country_code => "CL", :identifier => "123456789"}
+ ],
+ )
+
+ result.should be_success
+ end
+
it "can create without any attributes" do
result = Braintree::Customer.create
result.success?.should == true
end
@@ -1327,9 +1339,24 @@
:cardholder_name => "New Joe Cardholder",
:number => Braintree::Test::CreditCardNumbers::Visa,
:expiration_date => "12/2009",
:options => {:verify_card => true, :verification_amount => "2.00"}
},
+ )
+ result.success?.should == true
+ end
+
+ it "can update a tax_identifier" do
+ customer = Braintree::Customer.create!(
+ :tax_identifiers => [
+ {:country_code => "US", :identifier => "987654321"},
+ {:country_code => "CL", :identifier => "123456789"}
+ ],
+ )
+
+ result = Braintree::Customer.update(
+ customer.id,
+ :tax_identifiers => [{:country_code => "US", :identifier => "567891234"}],
)
result.success?.should == true
end
it "validates presence of three_d_secure_version in 3ds pass thru params" do