Sha256: d6efd1b7f4de8e5af2794b9ad90701fe970e9772b8f267b402ce6703630491a2

Contents?: true

Size: 556 Bytes

Versions: 20

Compression:

Stored size: 556 Bytes

Contents

FactoryBot.define do
  factory :address, aliases: [:bill_address, :ship_address], class: Spree::Address do
    firstname 'John'
    lastname 'Doe'
    company 'Company'
    address1 '10 Lovely Street'
    address2 'Northwest'
    city 'Herndon'
    zipcode '35005'
    phone '555-555-0199'
    alternative_phone '555-555-0199'

    state { |address| address.association(:state) || Spree::State.last }
    country do |address|
      if address.state
        address.state.country
      else
        address.association(:country)
      end
    end
  end
end

Version data entries

20 entries across 20 versions & 1 rubygems

Version Path
spree_core-3.4.6 lib/spree/testing_support/factories/address_factory.rb
spree_core-3.2.9 lib/spree/testing_support/factories/address_factory.rb
spree_core-3.6.6 lib/spree/testing_support/factories/address_factory.rb
spree_core-3.6.5 lib/spree/testing_support/factories/address_factory.rb
spree_core-3.6.4 lib/spree/testing_support/factories/address_factory.rb
spree_core-3.6.3 lib/spree/testing_support/factories/address_factory.rb
spree_core-3.6.2 lib/spree/testing_support/factories/address_factory.rb
spree_core-3.6.1 lib/spree/testing_support/factories/address_factory.rb
spree_core-3.6.0 lib/spree/testing_support/factories/address_factory.rb
spree_core-3.5.0 lib/spree/testing_support/factories/address_factory.rb
spree_core-3.3.6 lib/spree/testing_support/factories/address_factory.rb
spree_core-3.2.8 lib/spree/testing_support/factories/address_factory.rb
spree_core-3.6.0.rc1 lib/spree/testing_support/factories/address_factory.rb
spree_core-3.5.0.rc2 lib/spree/testing_support/factories/address_factory.rb
spree_core-3.5.0.rc1 lib/spree/testing_support/factories/address_factory.rb
spree_core-3.4.5 lib/spree/testing_support/factories/address_factory.rb
spree_core-3.3.5 lib/spree/testing_support/factories/address_factory.rb
spree_core-3.4.4 lib/spree/testing_support/factories/address_factory.rb
spree_core-3.4.3 lib/spree/testing_support/factories/address_factory.rb
spree_core-3.4.2 lib/spree/testing_support/factories/address_factory.rb