From 833aae23e573d473d52fcb91b786d0531cd23601 Mon Sep 17 00:00:00 2001 From: Matt-Yorkley <9029026+Matt-Yorkley@users.noreply.github.com> Date: Thu, 11 Feb 2021 16:53:59 +0000 Subject: [PATCH] Update admin adjustments controller --- app/controllers/spree/admin/adjustments_controller.rb | 6 +++++- spec/features/admin/order_spec.rb | 2 +- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/app/controllers/spree/admin/adjustments_controller.rb b/app/controllers/spree/admin/adjustments_controller.rb index 0728d8e6c9..9e0cf85374 100644 --- a/app/controllers/spree/admin/adjustments_controller.rb +++ b/app/controllers/spree/admin/adjustments_controller.rb @@ -15,7 +15,11 @@ module Spree end def collection - parent.adjustments.eligible + parent.adjustments.eligible | parent.shipment_adjustments.shipping + end + + def find_resource + parent.all_adjustments.eligible.find(params[:id]) end # Choose a default tax rate to show on the edit form. The adjustment stores its included diff --git a/spec/features/admin/order_spec.rb b/spec/features/admin/order_spec.rb index 1a85278b2d..db430ceb18 100644 --- a/spec/features/admin/order_spec.rb +++ b/spec/features/admin/order_spec.rb @@ -323,7 +323,7 @@ feature ' scenario "editing shipping fees" do click_link "Adjustments" - shipping_adjustment_tr_selector = "tr#spree_adjustment_#{order.adjustments.shipping.first.id}" + shipping_adjustment_tr_selector = "tr#spree_adjustment_#{order.shipment_adjustments.first.id}" page.find("#{shipping_adjustment_tr_selector} td.actions a.icon-edit").click fill_in "Amount", with: "5"