Deliver a warning if attempting to create an invalid taxed_product from factory

This commit is contained in:
Rohan Mitchell
2015-04-02 12:33:55 +11:00
parent beec910445
commit 829d11d4b2

View File

@@ -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