spec/unit/braintree/credit_card_spec.rb in braintree-3.3.0 vs spec/unit/braintree/credit_card_spec.rb in braintree-3.4.0
- old
+ new
@@ -2,11 +2,11 @@
describe Braintree::CreditCard do
describe "self.create" do
it "raises an exception if attributes contain an invalid key" do
expect do
- Braintree::CreditCard.create(:invalid_key => 'val')
+ Braintree::CreditCard.create(:invalid_key => "val")
end.to raise_error(ArgumentError, "invalid keys: invalid_key")
end
end
describe "self.create_signature" do
@@ -201,11 +201,11 @@
describe "masked_number" do
it "uses the bin and last_4 to build the masked number" do
credit_card = Braintree::CreditCard._new(
:gateway,
:bin => "510510",
- :last_4 => "5100"
+ :last_4 => "5100",
)
credit_card.masked_number.should == "510510******5100"
end
end
@@ -213,30 +213,30 @@
it "returns true" do
credit_card = Braintree::CreditCard._new(
:gateway,
:bin => "510510",
:last_4 => "5100",
- :is_network_tokenized => true
+ :is_network_tokenized => true,
)
credit_card.is_network_tokenized?.should == true
end
it "returns false" do
credit_card = Braintree::CreditCard._new(
:gateway,
:bin => "510510",
:last_4 => "5100",
- :is_network_tokenized => false
+ :is_network_tokenized => false,
)
credit_card.is_network_tokenized?.should == false
end
end
describe "self.update" do
it "raises an exception if attributes contain an invalid key" do
expect do
- Braintree::CreditCard.update(:gateway, :invalid_key => 'val')
+ Braintree::CreditCard.update(:gateway, :invalid_key => "val")
end.to raise_error(ArgumentError, "invalid keys: invalid_key")
end
end
describe "self.new" do
@@ -248,11 +248,11 @@
end
describe "self._new" do
describe "initializing verification" do
it "picks the youngest verification" do
- verification1 = { :created_at => Time.now, :id => 123 }
- verification2 = { :created_at => Time.now - 3600, :id => 456 }
+ verification1 = {:created_at => Time.now, :id => 123}
+ verification2 = {:created_at => Time.now - 3600, :id => 456}
credit_card = Braintree::CreditCard._new(Braintree::Configuration.gateway, {:verifications => [verification1, verification2]})
credit_card.verification.id.should == 123
end
it "picks nil if verifications are empty" do