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

@@ -40,7 +40,7 @@ module Spree
describe "tax category" do
context "when a tax category is required" do
before { Spree::Config.products_require_tax_category = true }
around { |example| with_products_require_tax_category(true) { example.run } }
it "is invalid when a tax category is not provided" do
build(:product, tax_category_id: nil).should_not be_valid
@@ -48,7 +48,7 @@ module Spree
end
context "when a tax category is not required" do
before { Spree::Config.products_require_tax_category = false }
around { |example| with_products_require_tax_category(false) { example.run } }
it "is valid when a tax category is not provided" do
build(:product, tax_category_id: nil).should be_valid