From d4c9d70caa7db3017248d6c41f8acbd98034c382 Mon Sep 17 00:00:00 2001 From: Matt-Yorkley <9029026+Matt-Yorkley@users.noreply.github.com> Date: Thu, 11 Feb 2021 00:09:57 +0000 Subject: [PATCH] Update Adjustment specs --- spec/models/spree/adjustment_spec.rb | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/spec/models/spree/adjustment_spec.rb b/spec/models/spree/adjustment_spec.rb index 2ddf0400c8..6317f5add9 100644 --- a/spec/models/spree/adjustment_spec.rb +++ b/spec/models/spree/adjustment_spec.rb @@ -265,14 +265,14 @@ module Spree allow(Config).to receive(:shipping_tax_rate).and_return(0) order.shipments = [shipment] - expect(order.adjustments.first.included_tax).to eq(0) + expect(order.shipment_adjustments.first.included_tax).to eq(0) end it "records 0% tax on shipments when a rate is set but shipment_inc_vat is false" do allow(Config).to receive(:shipping_tax_rate).and_return(0.25) order.shipments = [shipment] - expect(order.adjustments.first.included_tax).to eq(0) + expect(order.shipment_adjustments.first.included_tax).to eq(0) end end @@ -289,21 +289,21 @@ module Spree # total - ( total / (1 + rate) ) # 50 - ( 50 / (1 + 0.25) ) # = 10 - expect(order.adjustments.first.included_tax).to eq(10.00) + expect(order.shipment_adjustments.first.included_tax).to eq(10.00) end it "records 0% tax on shipments when shipping_tax_rate is not set" do allow(Config).to receive(:shipping_tax_rate).and_return(0) order.shipments = [shipment] - expect(order.adjustments.first.included_tax).to eq(0) + expect(order.shipment_adjustments.first.included_tax).to eq(0) end it "records 0% tax on shipments when the distributor does not charge sales tax" do order.distributor.update! charges_sales_tax: false order.shipments = [shipment] - expect(order.adjustments.first.included_tax).to eq(0) + expect(order.shipment_adjustments.first.included_tax).to eq(0) end end end