Sha256: a50a3d12e88b526ad93c392d67af7ca7badeb309bf6b7aaf2be87b729a57da34

Contents?: true

Size: 676 Bytes

Versions: 7

Compression:

Stored size: 676 Bytes

Contents

require 'spec_helper.rb'

describe Paypal::Payment::Response::Address do
  let :keys do
    Paypal::Payment::Response::Address.optional_attributes
  end

  describe '.new' do
    it 'should allow nil for attributes' do
      payer = Paypal::Payment::Response::Address.new
      keys.each do |key|
        expect(payer.send(key)).to be_nil
      end
    end

    it 'should treat all attributes as String' do
      attributes = keys.inject({}) do |attributes, key|
        attributes.merge!(key => "xyz")
      end
      payer = Paypal::Payment::Response::Address.new attributes
      keys.each do |key|
        expect(payer.send(key)).to eq("xyz")
      end
    end
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
ianfleeton-paypal-express-1.0.0 spec/paypal/payment/response/address_spec.rb
ianfleeton-paypal-express-0.8.7 spec/paypal/payment/response/address_spec.rb
ianfleeton-paypal-express-0.8.6 spec/paypal/payment/response/address_spec.rb
ianfleeton-paypal-express-0.8.5 spec/paypal/payment/response/address_spec.rb
ianfleeton-paypal-express-0.8.4 spec/paypal/payment/response/address_spec.rb
ianfleeton-paypal-express-0.8.3 spec/paypal/payment/response/address_spec.rb
ianfleeton-paypal-express-0.8.2 spec/paypal/payment/response/address_spec.rb