mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-03-12 03:50:22 +00:00
Ensure that changes to Spree::Config.products_require_tax_category do not leak out of the relevant spec
This commit is contained in:
12
spec/support/products_helper.rb
Normal file
12
spec/support/products_helper.rb
Normal file
@@ -0,0 +1,12 @@
|
||||
module OpenFoodNetwork
|
||||
module ProductsHelper
|
||||
def with_products_require_tax_category(value)
|
||||
original_value = Spree::Config.products_require_tax_category
|
||||
|
||||
Spree::Config.products_require_tax_category = value
|
||||
yield
|
||||
ensure
|
||||
Spree::Config.products_require_tax_category = original_value
|
||||
end
|
||||
end
|
||||
end
|
||||
Reference in New Issue
Block a user