Sha256: aebd57e78a16602ffbee5ac5566ce57cdf3530ebc6f706ef39e1c8fdf27507aa
Contents?: true
Size: 728 Bytes
Versions: 6
Compression:
Stored size: 728 Bytes
Contents
FactoryBot.define do factory :base_shipping_method, class: Spree::ShippingMethod do zones { |a| [Spree::Zone.global] } name 'UPS Ground' code 'UPS_GROUND' before(:create) do |shipping_method, evaluator| if shipping_method.shipping_categories.empty? shipping_method.shipping_categories << (Spree::ShippingCategory.first || create(:shipping_category)) end end factory :shipping_method, class: Spree::ShippingMethod do association(:calculator, factory: :shipping_calculator, strategy: :build) end factory :free_shipping_method, class: Spree::ShippingMethod do association(:calculator, factory: :shipping_no_amount_calculator, strategy: :build) end end end
Version data entries
6 entries across 6 versions & 2 rubygems