Sha256: 5e2587221c3bade0b9488df28edc410c02c7304097b06b5fbb653631153685b9

Contents?: true

Size: 557 Bytes

Versions: 43

Compression:

Stored size: 557 Bytes

Contents

FactoryGirl.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

43 entries across 43 versions & 1 rubygems

Version Path
spree_core-3.1.14 lib/spree/testing_support/factories/address_factory.rb
spree_core-3.1.13 lib/spree/testing_support/factories/address_factory.rb
spree_core-3.3.4 lib/spree/testing_support/factories/address_factory.rb
spree_core-3.2.7 lib/spree/testing_support/factories/address_factory.rb
spree_core-3.1.12 lib/spree/testing_support/factories/address_factory.rb
spree_core-3.3.3 lib/spree/testing_support/factories/address_factory.rb
spree_core-3.2.6 lib/spree/testing_support/factories/address_factory.rb
spree_core-3.1.11 lib/spree/testing_support/factories/address_factory.rb
spree_core-3.4.1 lib/spree/testing_support/factories/address_factory.rb
spree_core-3.4.0 lib/spree/testing_support/factories/address_factory.rb
spree_core-3.4.0.rc2 lib/spree/testing_support/factories/address_factory.rb
spree_core-3.1.10 lib/spree/testing_support/factories/address_factory.rb
spree_core-3.4.0.rc1 lib/spree/testing_support/factories/address_factory.rb
spree_core-3.3.2 lib/spree/testing_support/factories/address_factory.rb
spree_core-3.2.5 lib/spree/testing_support/factories/address_factory.rb
spree_core-3.1.9 lib/spree/testing_support/factories/address_factory.rb
spree_core-3.3.1 lib/spree/testing_support/factories/address_factory.rb
spree_core-3.2.4 lib/spree/testing_support/factories/address_factory.rb
spree_core-3.1.8 lib/spree/testing_support/factories/address_factory.rb
spree_core-3.3.0 lib/spree/testing_support/factories/address_factory.rb