spec/unit/braintree/credit_card_spec.rb in braintree-2.12.0 vs spec/unit/braintree/credit_card_spec.rb in braintree-2.13.0

- old
+ new

@@ -117,9 +117,29 @@ it "is false if the credit card is not the default credit card for the customer" do Braintree::CreditCard._new(:gateway, :default => false).default?.should == false end end + describe "self.find" do + it "raises error if passed empty string" do + expect do + Braintree::CreditCard.find("") + end.to raise_error(ArgumentError) + end + + it "raises error if passed invalid string" do + expect do + Braintree::CreditCard.find("\t") + end.to raise_error(ArgumentError) + end + + it "raises error if passed nil" do + expect do + Braintree::CreditCard.find(nil) + end.to raise_error(ArgumentError) + end + end + describe "inspect" do it "includes the token first" do output = Braintree::CreditCard._new(:gateway, :token => "cc123").inspect output.should include("#<Braintree::CreditCard token: \"cc123\",") end