From 34ae3ca24d8d6a83cd08b7f71c307d01cb8d6455 Mon Sep 17 00:00:00 2001 From: Luis Ramos Date: Mon, 25 Jan 2021 19:56:25 +0000 Subject: [PATCH] Replace spree_order_url with order_url so we can use scope in the routes file --- app/views/subscription_mailer/_summary_detail.html.haml | 4 ++-- app/views/subscription_mailer/confirmation_email.html.haml | 2 +- .../subscription_mailer/failed_payment_email.html.haml | 2 +- app/views/subscription_mailer/placement_email.html.haml | 2 +- spec/mailers/subscription_mailer_spec.rb | 6 +++--- 5 files changed, 8 insertions(+), 8 deletions(-) diff --git a/app/views/subscription_mailer/_summary_detail.html.haml b/app/views/subscription_mailer/_summary_detail.html.haml index ff0d13872c..9e99633dcb 100644 --- a/app/views/subscription_mailer/_summary_detail.html.haml +++ b/app/views/subscription_mailer/_summary_detail.html.haml @@ -6,7 +6,7 @@ - separator = messages.values.any? ? ": " : ", " - orders.each_with_index do |order, i| - %a{ href: spree_order_url(order) }>= order.number + %a{ href: order_url(order) }>= order.number = separator if messages.values.any? || i < orders.count - 1 - if messages.values.any? = messages[order.id] || t(".no_message_provided") @@ -17,5 +17,5 @@ %h4= t(".other.title", count: orders.count) %p= t(".other.explainer") - orders.each_with_index do |order, i| - %a{ href: spree_order_url(order) }>= order.number + %a{ href: order_url(order) }>= order.number = ", " if i < orders.count - 1 diff --git a/app/views/subscription_mailer/confirmation_email.html.haml b/app/views/subscription_mailer/confirmation_email.html.haml index 0c2b274fb1..5a8d4d4ded 100644 --- a/app/views/subscription_mailer/confirmation_email.html.haml +++ b/app/views/subscription_mailer/confirmation_email.html.haml @@ -6,7 +6,7 @@ - if @order.user.present? = t("email_so_edit_false_html", orders_close_at: l(@order.order_cycle.orders_close_at, format: mail_long_datetime_format), - order_url: spree_order_url(@order)) + order_url: order_url(@order)) = t("email_so_contact_distributor_html", distributor: @order.distributor.name, email: @order.distributor.contact.email) %p   diff --git a/app/views/subscription_mailer/failed_payment_email.html.haml b/app/views/subscription_mailer/failed_payment_email.html.haml index bb02532d77..275c2dbce5 100644 --- a/app/views/subscription_mailer/failed_payment_email.html.haml +++ b/app/views/subscription_mailer/failed_payment_email.html.haml @@ -5,7 +5,7 @@ - if @order.user.present? = t("email_so_edit_false_html", orders_close_at: l(@order.order_cycle.orders_close_at, format: mail_long_datetime_format), - order_url: spree_order_url(@order)) + order_url: order_url(@order)) = t("email_so_contact_distributor_html", distributor: @order.distributor.name, email: @order.distributor.contact.email) - if @order.errors.any? diff --git a/app/views/subscription_mailer/placement_email.html.haml b/app/views/subscription_mailer/placement_email.html.haml index bfcefb6a7e..c146935fc3 100644 --- a/app/views/subscription_mailer/placement_email.html.haml +++ b/app/views/subscription_mailer/placement_email.html.haml @@ -8,7 +8,7 @@ - allow_changes = !!@order.distributor.allow_order_changes? = t("email_so_edit_#{allow_changes}_html", orders_close_at: l(@order.order_cycle.orders_close_at, format: mail_long_datetime_format), - order_url: spree_order_url(@order)) + order_url: order_url(@order)) = t("email_so_contact_distributor_html", distributor: @order.distributor.name, email: @order.distributor.contact.email) - else = t("email_so_contact_distributor_to_change_order_html", diff --git a/spec/mailers/subscription_mailer_spec.rb b/spec/mailers/subscription_mailer_spec.rb index f224fbe960..f50f58b5e4 100644 --- a/spec/mailers/subscription_mailer_spec.rb +++ b/spec/mailers/subscription_mailer_spec.rb @@ -47,7 +47,7 @@ describe SubscriptionMailer, type: :mailer do end describe "linking to order page" do - let(:order_link_href) { "href=\"#{spree_order_url(order)}\"" } + let(:order_link_href) { "href=\"#{order_url(order)}\"" } let(:order_link_style) { "style='[^']+'" } let(:shop) { create(:enterprise, allow_order_changes: true) } @@ -113,7 +113,7 @@ describe SubscriptionMailer, type: :mailer do end describe "linking to order page" do - let(:order_link_href) { "href=\"#{spree_order_url(order)}\"" } + let(:order_link_href) { "href=\"#{order_url(order)}\"" } let(:email) { SubscriptionMailer.deliveries.last } let(:body) { email.body.encoded } @@ -179,7 +179,7 @@ describe SubscriptionMailer, type: :mailer do end describe "linking to order page" do - let(:order_link_href) { "href=\"#{spree_order_url(order)}\"" } + let(:order_link_href) { "href=\"#{order_url(order)}\"" } let(:email) { SubscriptionMailer.deliveries.last } let(:body) { email.body.encoded }