From 0243e5cbb8e7b3ed385c64233576dfe556877ea2 Mon Sep 17 00:00:00 2001 From: Luis Ramos Date: Thu, 13 May 2021 23:08:40 +0100 Subject: [PATCH 1/4] Fix route in order view --- app/views/spree/shared/_order_details.html.haml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/views/spree/shared/_order_details.html.haml b/app/views/spree/shared/_order_details.html.haml index 5735136d35..3368215cc5 100644 --- a/app/views/spree/shared/_order_details.html.haml +++ b/app/views/spree/shared/_order_details.html.haml @@ -41,7 +41,7 @@ = t(:orders_changeable_orders_alert_html, oc_close: l(order.order_cycle.orders_close_at, format: "%b %d, %Y %H:%M")) %a.close{ "ng-click" => "close()" } × - = form_for order, url: order_path(order), html: {id: 'update-order', name: 'update_order_form' } do |order_form| + = form_for order, url: main_app.order_path(order), html: {id: 'update-order', name: 'update_order_form' } do |order_form| - if order.changes_allowed? = render 'spree/orders/form', order_form: order_form -else From a949422ac9a226d865d53121ad945a52fbc60567 Mon Sep 17 00:00:00 2001 From: Luis Ramos Date: Thu, 13 May 2021 23:28:35 +0100 Subject: [PATCH 2/4] Adapt view spec stubs to rails 6 --- .../views/spree/admin/payment_methods/index.html.haml_spec.rb | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/spec/views/spree/admin/payment_methods/index.html.haml_spec.rb b/spec/views/spree/admin/payment_methods/index.html.haml_spec.rb index 2fb34ef37e..2a8d4bd991 100644 --- a/spec/views/spree/admin/payment_methods/index.html.haml_spec.rb +++ b/spec/views/spree/admin/payment_methods/index.html.haml_spec.rb @@ -8,9 +8,7 @@ describe "spree/admin/payment_methods/index.html.haml" do helper Spree::Admin::BaseHelper before do - controller.singleton_class.class_eval do - helper_method :new_object_url, :edit_object_url, :object_url - + ActionView::Base.class_eval do def new_object_url() "" end def edit_object_url(_object, _options = {}) "" end From b1896733ca4d3083803f18c6384dc4b65670c230 Mon Sep 17 00:00:00 2001 From: Luis Ramos Date: Fri, 14 May 2021 00:08:07 +0100 Subject: [PATCH 3/4] Fix routes --- app/controllers/spree/orders_controller.rb | 6 +++--- spec/controllers/spree/orders_controller_spec.rb | 4 ---- 2 files changed, 3 insertions(+), 7 deletions(-) diff --git a/app/controllers/spree/orders_controller.rb b/app/controllers/spree/orders_controller.rb index 51bacbb588..b204fffdb5 100644 --- a/app/controllers/spree/orders_controller.rb +++ b/app/controllers/spree/orders_controller.rb @@ -101,7 +101,7 @@ module Spree @order.next_transition.run_callbacks if @order.cart? redirect_to main_app.checkout_state_path(@order.checkout_steps.first) elsif @order.complete? - redirect_to order_path(@order) + redirect_to main_app.order_path(@order) else redirect_to main_app.cart_path end @@ -157,7 +157,7 @@ module Spree else flash[:error] = I18n.t(:orders_could_not_cancel) end - redirect_to request.referer || order_path(@order) + redirect_to request.referer || main_app.order_path(@order) end private @@ -197,7 +197,7 @@ module Spree if items.empty? flash[:error] = I18n.t(:orders_cannot_remove_the_final_item) - redirect_to order_path(order_to_update) + redirect_to main_app.order_path(order_to_update) end end diff --git a/spec/controllers/spree/orders_controller_spec.rb b/spec/controllers/spree/orders_controller_spec.rb index 412b706cf5..155eba8654 100644 --- a/spec/controllers/spree/orders_controller_spec.rb +++ b/spec/controllers/spree/orders_controller_spec.rb @@ -225,10 +225,6 @@ describe Spree::OrdersController, type: :controller do describe "the page" do render_views - it "provides the right registration path" do - expect(subject.registration_path).to eq registration_path - end - it "shows the right registration link" do # We fixed our view by hardcoding the link. spree_registration_path = '/signup' From 90db52e5f59de1090b0e3cba872a867fba0f233c Mon Sep 17 00:00:00 2001 From: Luis Ramos Date: Fri, 14 May 2021 00:13:54 +0100 Subject: [PATCH 4/4] Fix route --- app/views/spree/orders/form/_update_buttons.html.haml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/views/spree/orders/form/_update_buttons.html.haml b/app/views/spree/orders/form/_update_buttons.html.haml index 012bfc9171..884cea6746 100644 --- a/app/views/spree/orders/form/_update_buttons.html.haml +++ b/app/views/spree/orders/form/_update_buttons.html.haml @@ -12,7 +12,7 @@ - if order.changes_allowed? .columns.show-for-medium-up.medium-3   .columns.small-12.medium-3 - = link_to cancel_order_path(@order), method: :put, :class => "button secondary expand", "confirm-link-click" => t('orders_confirm_cancel') do + = link_to main_app.cancel_order_path(@order), method: :put, :class => "button secondary expand", "confirm-link-click" => t('orders_confirm_cancel') do %i.ofn-i_009-close = t(:cancel_order) .columns.small-12.medium-3