Fix "Resend Confirmation" link and add missing test coverage

This commit is contained in:
Matt-Yorkley
2023-05-21 13:33:29 +01:00
parent dcdcdb4fc0
commit 005d95e882
3 changed files with 19 additions and 2 deletions

View File

@@ -62,7 +62,6 @@ module Spree
{ name: t(:resend_confirmation),
url: spree.resend_admin_order_path(@order),
icon: 'icon-email',
method: 'post',
confirm: t(:confirm_resend_order_confirmation) }
end

View File

@@ -86,7 +86,7 @@ Spree::Core::Engine.routes.draw do
member do
put :fire
get :fire
post :resend
get :resend
get :invoice
get :print
get :distribution

View File

@@ -611,6 +611,24 @@ describe '
href: spree.fire_admin_order_path(order, e: 'cancel')
end
end
context "Resending confirmation email" do
before do
visit spree.edit_admin_order_path(order)
find("#links-dropdown .ofn-drop-down").click
end
it "shows the link" do
expect(page).to have_link "Resend Confirmation", href: spree.resend_admin_order_path(order)
end
it "resends the confirmation email" do
accept_alert "Are you sure you want to resend the order confirmation email?" do
click_link "Resend Confirmation"
end
expect(page).to have_content "Order email has been resent"
end
end
context "Check send/print invoice links" do