Sha256: 3858fe91440ec9c46eb40dcfb55a48619db5e629db473326f2a0e20049f5032f

Contents?: true

Size: 303 Bytes

Versions: 102

Compression:

Stored size: 303 Bytes

Contents

FactoryBot.define do
  factory :state, class: Spree::State do
    sequence(:name) { |n| "STATE_NAME_#{n}" }
    sequence(:abbr) { |n| "STATE_ABBR_#{n}" }
    country do |country|
      usa = Spree::Country.find_by(numcode: 840)
      usa.present? ? usa : country.association(:country)
    end
  end
end

Version data entries

102 entries across 102 versions & 1 rubygems

Version Path
spree_core-4.2.4 lib/spree/testing_support/factories/state_factory.rb
spree_core-3.7.14.1 lib/spree/testing_support/factories/state_factory.rb
spree_core-4.2.3.1 lib/spree/testing_support/factories/state_factory.rb
spree_core-4.1.13.1 lib/spree/testing_support/factories/state_factory.rb
spree_core-4.0.7.1 lib/spree/testing_support/factories/state_factory.rb
spree_core-4.2.3 lib/spree/testing_support/factories/state_factory.rb
spree_core-4.2.2 lib/spree/testing_support/factories/state_factory.rb
spree_core-4.2.1 lib/spree/testing_support/factories/state_factory.rb
spree_core-4.0.7 lib/spree/testing_support/factories/state_factory.rb
spree_core-3.7.14 lib/spree/testing_support/factories/state_factory.rb
spree_core-4.2.0 lib/spree/testing_support/factories/state_factory.rb
spree_core-4.2.0.rc5 lib/spree/testing_support/factories/state_factory.rb
spree_core-4.2.0.rc4 lib/spree/testing_support/factories/state_factory.rb
spree_core-4.2.0.rc3 lib/spree/testing_support/factories/state_factory.rb
spree_core-4.1.13 lib/spree/testing_support/factories/state_factory.rb
spree_core-4.0.6 lib/spree/testing_support/factories/state_factory.rb
spree_core-4.2.0.rc2 lib/spree/testing_support/factories/state_factory.rb
spree_core-3.7.13 lib/spree/testing_support/factories/state_factory.rb
spree_core-4.0.5 lib/spree/testing_support/factories/state_factory.rb
spree_core-4.1.12 lib/spree/testing_support/factories/state_factory.rb