From 0d11b7b85940c5448de4bed5d753721bd9c5d38f Mon Sep 17 00:00:00 2001 From: Alessandro Lepore Date: Mon, 4 Dec 2017 17:38:00 +0100 Subject: [PATCH] Remove Transaction#phone validation There are situations, on Solidus or on Paypal, where we may have addresses without a phone number --- app/models/solidus_paypal_braintree/transaction.rb | 1 - spec/models/solidus_paypal_braintree/transaction_spec.rb | 6 ------ 2 files changed, 7 deletions(-) diff --git a/app/models/solidus_paypal_braintree/transaction.rb b/app/models/solidus_paypal_braintree/transaction.rb index e4b63250..44dfa2e3 100644 --- a/app/models/solidus_paypal_braintree/transaction.rb +++ b/app/models/solidus_paypal_braintree/transaction.rb @@ -9,7 +9,6 @@ class Transaction validates :nonce, presence: true validates :payment_method, presence: true validates :payment_type, presence: true - validates :phone, presence: true validates :email, presence: true validate do diff --git a/spec/models/solidus_paypal_braintree/transaction_spec.rb b/spec/models/solidus_paypal_braintree/transaction_spec.rb index 8db8c5b9..7fe6fbe1 100644 --- a/spec/models/solidus_paypal_braintree/transaction_spec.rb +++ b/spec/models/solidus_paypal_braintree/transaction_spec.rb @@ -8,7 +8,6 @@ nonce: 'abcde-fghjkl-lmnop', payment_method: SolidusPaypalBraintree::Gateway.new, payment_type: 'ApplePayCard', - phone: "555-1234", email: "test@example.com" } end @@ -51,11 +50,6 @@ it { is_expected.to be false } end - context 'no phone' do - let(:valid_attributes) { super().except(:phone) } - it { is_expected.to be false } - end - context 'no email' do let(:valid_attributes) { super().except(:email) } it { is_expected.to be false }