Sha256: 997e21e1a5f182a986b184c99bb70ed051d9e29a21cbd17d88073c115a6ae424

Contents?: true

Size: 563 Bytes

Versions: 48

Compression:

Stored size: 563 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 }

    # FIXME: We should set states required, but it causes failing tests
    # states_required { carmen_country.subregions? }
  end
end

Version data entries

48 entries across 48 versions & 2 rubygems

Version Path
solidus_core-2.10.5 lib/spree/testing_support/factories/country_factory.rb
solidus_core-2.11.3 lib/spree/testing_support/factories/country_factory.rb
solidus_core-2.11.2 lib/spree/testing_support/factories/country_factory.rb
solidus_core-2.11.1 lib/spree/testing_support/factories/country_factory.rb
solidus_core-2.10.3 lib/spree/testing_support/factories/country_factory.rb
solidus_core-2.11.0 lib/spree/testing_support/factories/country_factory.rb
solidus_core-2.10.2 lib/spree/testing_support/factories/country_factory.rb
solidus_core-2.9.6 lib/spree/testing_support/factories/country_factory.rb
solidus_core-2.8.6 lib/spree/testing_support/factories/country_factory.rb
solidus_core-2.10.1 lib/spree/testing_support/factories/country_factory.rb
solidus_core-2.9.5 lib/spree/testing_support/factories/country_factory.rb
solidus_core-2.10.0 lib/spree/testing_support/factories/country_factory.rb
solidus_core-2.9.4 lib/spree/testing_support/factories/country_factory.rb
solidus_core-2.6.6 lib/spree/testing_support/factories/country_factory.rb
solidus_core-2.7.4 lib/spree/testing_support/factories/country_factory.rb
solidus_core-2.8.5 lib/spree/testing_support/factories/country_factory.rb
solidus_core-2.9.3 lib/spree/testing_support/factories/country_factory.rb
solidus_core-2.9.2 lib/spree/testing_support/factories/country_factory.rb
solidus_core-2.10.0.beta1 lib/spree/testing_support/factories/country_factory.rb
solidus_core-2.7.3 lib/spree/testing_support/factories/country_factory.rb