Sha256: c601103c8b72a41f2f362a7e333446c531230499e6cd6fa4df3274f84ce09d8b

Contents?: true

Size: 489 Bytes

Versions: 23

Compression:

Stored size: 489 Bytes

Contents

# frozen_string_literal: true

require 'carmen'

FactoryBot.define do
  factory :country, class: 'Spree::Country' do
    iso { 'US' }

    transient do
      carmen_country { Carmen::Country.coded(iso) || fail("Unknown country iso code: #{iso.inspect}") }
    end

    iso_name { carmen_country.name.upcase }
    name { carmen_country.name }
    iso3 { carmen_country.alpha_3_code }
    numcode { carmen_country.numeric_code }

    states_required { carmen_country.subregions? }
  end
end

Version data entries

23 entries across 23 versions & 1 rubygems

Version Path
solidus_core-4.4.1 lib/spree/testing_support/factories/country_factory.rb
solidus_core-4.4.0 lib/spree/testing_support/factories/country_factory.rb
solidus_core-4.3.4 lib/spree/testing_support/factories/country_factory.rb
solidus_core-4.2.4 lib/spree/testing_support/factories/country_factory.rb
solidus_core-4.1.5 lib/spree/testing_support/factories/country_factory.rb
solidus_core-4.3.3 lib/spree/testing_support/factories/country_factory.rb
solidus_core-4.3.2 lib/spree/testing_support/factories/country_factory.rb
solidus_core-4.1.4 lib/spree/testing_support/factories/country_factory.rb
solidus_core-4.3.1 lib/spree/testing_support/factories/country_factory.rb
solidus_core-4.3.0 lib/spree/testing_support/factories/country_factory.rb
solidus_core-4.2.3 lib/spree/testing_support/factories/country_factory.rb
solidus_core-4.1.3 lib/spree/testing_support/factories/country_factory.rb
solidus_core-4.0.4 lib/spree/testing_support/factories/country_factory.rb
solidus_core-4.0.3 lib/spree/testing_support/factories/country_factory.rb
solidus_core-4.1.2 lib/spree/testing_support/factories/country_factory.rb
solidus_core-4.2.2 lib/spree/testing_support/factories/country_factory.rb
solidus_core-4.2.1 lib/spree/testing_support/factories/country_factory.rb
solidus_core-4.2.0 lib/spree/testing_support/factories/country_factory.rb
solidus_core-4.1.1 lib/spree/testing_support/factories/country_factory.rb
solidus_core-4.0.2 lib/spree/testing_support/factories/country_factory.rb