mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-01-31 21:37:16 +00:00
Bring the final batch of factories from spree_core
This commit is contained in:
9
spec/factories/country_factory.rb
Normal file
9
spec/factories/country_factory.rb
Normal file
@@ -0,0 +1,9 @@
|
||||
FactoryBot.define do
|
||||
factory :country, class: Spree::Country do
|
||||
iso_name 'UNITED STATES'
|
||||
name 'United States of America'
|
||||
iso 'US'
|
||||
iso3 'USA'
|
||||
numcode 840
|
||||
end
|
||||
end
|
||||
8
spec/factories/inventory_unit_factory.rb
Normal file
8
spec/factories/inventory_unit_factory.rb
Normal file
@@ -0,0 +1,8 @@
|
||||
FactoryBot.define do
|
||||
factory :inventory_unit, class: Spree::InventoryUnit do
|
||||
variant
|
||||
order
|
||||
state 'on_hand'
|
||||
association(:shipment, factory: :shipment, state: 'pending')
|
||||
end
|
||||
end
|
||||
6
spec/factories/product_option_type_factory.rb
Normal file
6
spec/factories/product_option_type_factory.rb
Normal file
@@ -0,0 +1,6 @@
|
||||
FactoryBot.define do
|
||||
factory :product_option_type, class: Spree::ProductOptionType do
|
||||
product
|
||||
option_type
|
||||
end
|
||||
end
|
||||
6
spec/factories/product_property_factory.rb
Normal file
6
spec/factories/product_property_factory.rb
Normal file
@@ -0,0 +1,6 @@
|
||||
FactoryBot.define do
|
||||
factory :product_property, class: Spree::ProductProperty do
|
||||
product
|
||||
property
|
||||
end
|
||||
end
|
||||
6
spec/factories/property_factory.rb
Normal file
6
spec/factories/property_factory.rb
Normal file
@@ -0,0 +1,6 @@
|
||||
FactoryBot.define do
|
||||
factory :property, class: Spree::Property do
|
||||
name 'baseball_cap_color'
|
||||
presentation 'cap color'
|
||||
end
|
||||
end
|
||||
7
spec/factories/tax_rate_factory.rb
Normal file
7
spec/factories/tax_rate_factory.rb
Normal file
@@ -0,0 +1,7 @@
|
||||
FactoryBot.define do
|
||||
factory :tax_rate, class: Spree::TaxRate do
|
||||
zone
|
||||
amount 100.00
|
||||
tax_category
|
||||
end
|
||||
end
|
||||
6
spec/factories/zone_factory.rb
Normal file
6
spec/factories/zone_factory.rb
Normal file
@@ -0,0 +1,6 @@
|
||||
FactoryBot.define do
|
||||
factory :zone, class: Spree::Zone do
|
||||
name { generate(:random_string) }
|
||||
description { generate(:random_string) }
|
||||
end
|
||||
end
|
||||
Reference in New Issue
Block a user