mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-02-08 22:56:06 +00:00
Deliver a warning if attempting to create an invalid taxed_product from factory
This commit is contained in:
@@ -200,6 +200,7 @@ FactoryGirl.define do
|
||||
tax_category { create(:tax_category) }
|
||||
|
||||
after(:create) do |product, proxy|
|
||||
raise "taxed_product factory requires a zone" unless proxy.zone
|
||||
create(:tax_rate, amount: proxy.tax_rate_amount, tax_category: product.tax_category, included_in_price: true, calculator: Spree::Calculator::DefaultTax.new, zone: proxy.zone)
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user