Skip to content

armgit / spree

Public Imported from GitHub
0

Open Source Platform for DTC, B2B Commerce, Marketplaces & Omnichannel. REST APIs, TypeScript SDKs, and production-ready Next.js storefront. Self-host it. Own your data. No vendor lock-in. Zero platform fees.

Fix specs for VAT calculation. (#11678)

Matthew Kennedya9e450e0e6df
diff --git a/core/spec/models/spree/price_spec.rb b/core/spec/models/spree/price_spec.rb
index 53ad61af8b..3aa551f54b 100644
--- a/core/spec/models/spree/price_spec.rb
+++ b/core/spec/models/spree/price_spec.rb
@@ -115,8 +115,8 @@ describe Spree::Price, type: :model do
allow(variant).to receive(:tax_category).and_return(tax_category)
expect(price).to receive(:default_zone).at_least(:once).and_return(default_zone)
allow(price).to receive(:apply_foreign_vat?).and_return(true)
- allow(price).to receive(:included_tax_amount).with(tax_zone: default_zone, tax_category: tax_category).and_return(0.19)
- allow(price).to receive(:included_tax_amount).with(tax_zone: zone, tax_category: tax_category).and_return(0.25)
+ allow(price).to receive(:included_tax_amount).with({ tax_zone: default_zone, tax_category: tax_category }).and_return(0.19)
+ allow(price).to receive(:included_tax_amount).with({ tax_zone: zone, tax_category: tax_category }).and_return(0.25)
end
it 'returns the correct price including another VAT to two digits' do
@@ -166,8 +166,8 @@ describe Spree::Price, type: :model do
allow(variant).to receive(:tax_category).and_return(tax_category)
expect(price).to receive(:default_zone).at_least(:once).and_return(default_zone)
allow(price).to receive(:apply_foreign_vat?).and_return(true)
- allow(price).to receive(:included_tax_amount).with(tax_zone: default_zone, tax_category: tax_category).and_return(0.19)
- allow(price).to receive(:included_tax_amount).with(tax_zone: zone, tax_category: tax_category).and_return(0.25)
+ allow(price).to receive(:included_tax_amount).with({ tax_zone: default_zone, tax_category: tax_category }).and_return(0.19)
+ allow(price).to receive(:included_tax_amount).with({ tax_zone: zone, tax_category: tax_category }).and_return(0.25)
end
it 'returns the correct price including another VAT to two digits' do