Sha256: 157e51d1d39bafb3e619dba401cd3bd6bf2541685fa0075121576c4ea09a36c7

Contents?: true

Size: 820 Bytes

Versions: 2

Compression:

Stored size: 820 Bytes

Contents

require 'spree/testing_support/factories'

unless FACTORY_BOT_CLASS.factories.registered?(:europe_address)
  FACTORY_BOT_CLASS.define do
    factory :europe_address, class: Spree::Address do
      firstname         { FFaker::Name.first_name }
      lastname          { FFaker::Name.last_name }
      address1          { '10 Paternoster Sq' }
      address2          { '' }
      city              { 'London' }
      zipcode           { 'EC4M 7LS' }
      phone             { FFaker::PhoneNumberAU.mobile_phone_number }
      alternative_phone { FFaker::PhoneNumberAU.mobile_phone_number }

      country do
        uk_attributes = { name: 'United Kingdom', iso_name: 'UNITED KINGDOM', iso: 'GB', iso3: 'GBR' }

        Spree::Country.find_by(uk_attributes) || create(:country, uk_attributes)
      end
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
spree_avatax_official-1.8.0 spec/factories/europe_address_factory.rb
spree_avatax_official-1.7.1 spec/factories/europe_address_factory.rb