From 02fb2c6a5582f9d08442f0dbc780a7eac85cf4ac Mon Sep 17 00:00:00 2001 From: Matt-Yorkley <9029026+Matt-Yorkley@users.noreply.github.com> Date: Wed, 10 Feb 2021 20:08:28 +0000 Subject: [PATCH] Update CheckoutHelper --- app/helpers/checkout_helper.rb | 2 +- spec/helpers/checkout_helper_spec.rb | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/app/helpers/checkout_helper.rb b/app/helpers/checkout_helper.rb index cae6bc1657..47d2522afe 100644 --- a/app/helpers/checkout_helper.rb +++ b/app/helpers/checkout_helper.rb @@ -7,7 +7,7 @@ module CheckoutHelper adjustments = order.adjustments.eligible exclude = opts[:exclude] || {} - adjustments = adjustments.to_a + adjustments = adjustments.to_a + order.shipment_adjustments.to_a # Remove empty tax adjustments and (optionally) shipping fees adjustments.reject! { |a| a.originator_type == 'Spree::TaxRate' && a.amount == 0 } diff --git a/spec/helpers/checkout_helper_spec.rb b/spec/helpers/checkout_helper_spec.rb index 7dcf64b0c5..076f1f9fb5 100644 --- a/spec/helpers/checkout_helper_spec.rb +++ b/spec/helpers/checkout_helper_spec.rb @@ -41,14 +41,14 @@ describe CheckoutHelper, type: :helper do before do # Sanity check initial adjustments state - expect(order.adjustments.shipping.count).to eq 1 + expect(order.shipment_adjustments.count).to eq 1 expect(order.adjustments.enterprise_fee.count).to eq 1 end it "collects adjustments on the order" do adjustments = helper.checkout_adjustments_for(order) - shipping_adjustment = order.adjustments.shipping.first + shipping_adjustment = order.shipment_adjustments.first expect(adjustments).to include shipping_adjustment admin_fee_summary = adjustments.last