spec/integration/braintree/credit_card_spec.rb in braintree-2.102.0 vs spec/integration/braintree/credit_card_spec.rb in braintree-2.103.0

- old
+ new

@@ -13,11 +13,11 @@ customer = Braintree::Customer.create! result = Braintree::CreditCard.create( :customer_id => customer.id, :number => Braintree::Test::CreditCardNumbers::Visa, :expiration_date => "05/2009", - :cvv => "100" + :cvv => "100", ) result.success?.should == true credit_card = result.credit_card credit_card.token.should =~ /\A\w{4,}\z/ credit_card.bin.should == Braintree::Test::CreditCardNumbers::Visa[0, 6] @@ -1847,8 +1847,26 @@ :number => Braintree::Test::CreditCardNumbers::Visa, :expiration_date => "05/2012" ) credit_card.nonce.should_not be_nil + end + end + + describe "card on file network tokenization" do + it "should find a network tokenized credit card" do + credit_card = Braintree::CreditCard.find("network_tokenized_credit_card") + credit_card.is_network_tokenized?.should == true + end + + it "should find a non-network tokenized credit card" do + customer = Braintree::Customer.create! + credit_card = Braintree::CreditCard.create( + :customer_id => customer.id, + :number => Braintree::Test::CreditCardNumbers::Visa, + :expiration_date => "05/2009" + ).credit_card + credit_card_vaulted = Braintree::CreditCard.find(credit_card.token) + credit_card_vaulted.is_network_tokenized?.should == false end end end