Sha256: bde613a8fd04d2f2b8d5a6e5039682e4b8e4fc9cec3c9e06060f4c92d5d9723b

Contents?: true

Size: 953 Bytes

Versions: 2

Compression:

Stored size: 953 Bytes

Contents

require 'spec_helper'

describe Spree::Gateway::BraintreeVzeroBase::Address, :vcr do
  let(:gateway) { create(:vzero_gateway, auto_capture: true) }
  let(:user) { create(:user) }
  let(:order) { create(:order) }
  let(:braintree_address) { Spree::Gateway::BraintreeVzeroBase::Address.new(gateway.provider, order) }

  context '#create' do
    it 'creates Braintree Address' do
      expect(braintree_address.create.address.id).to_not be_nil
    end

    it 'finds Braintree Address' do
      expect(braintree_address.find(braintree_address.create.address)).to_not be_nil
    end

    it 'updates Braintree Address' do
      result = braintree_address.update(braintree_address.create.address, first_name: 'new_name')
      expect(result.address.first_name).to eq 'new_name'
    end

    it 'deletes Braintree Address' do
      result = braintree_address.create
      expect(braintree_address.delete(result.address).success?).to be true
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
spree_braintree_vzero-3.6.0 spec/models/gateway/braintree_vzero_base/address_spec.rb
spree_braintree_vzero-3.5.1 spec/models/gateway/braintree_vzero_base/address_spec.rb