Sha256: ae81d9892370ed9f4914bac2d8aca2ae33be0433734e040cfdce835d08581edc

Contents?: true

Size: 331 Bytes

Versions: 11

Compression:

Stored size: 331 Bytes

Contents

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

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
spree_core-3.3.4 lib/spree/testing_support/factories/state_factory.rb
spree_core-3.3.3 lib/spree/testing_support/factories/state_factory.rb
spree_core-3.4.1 lib/spree/testing_support/factories/state_factory.rb
spree_core-3.4.0 lib/spree/testing_support/factories/state_factory.rb
spree_core-3.4.0.rc2 lib/spree/testing_support/factories/state_factory.rb
spree_core-3.4.0.rc1 lib/spree/testing_support/factories/state_factory.rb
spree_core-3.3.2 lib/spree/testing_support/factories/state_factory.rb
spree_core-3.3.1 lib/spree/testing_support/factories/state_factory.rb
spree_core-3.3.0 lib/spree/testing_support/factories/state_factory.rb
spree_core-3.3.0.rc4 lib/spree/testing_support/factories/state_factory.rb
spree_core-3.3.0.rc3 lib/spree/testing_support/factories/state_factory.rb