Ensure that changes to Spree::Config.products_require_tax_category do not leak out of the relevant spec

This commit is contained in:
Rohan Mitchell
2015-06-11 14:16:18 +10:00
parent 6dea3fa19d
commit bfeb63c8d7
4 changed files with 38 additions and 22 deletions

View 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