From 4eedf74ecd6af73b6620592b703601eff91d9158 Mon Sep 17 00:00:00 2001 From: Mohamed ABDELLANI Date: Tue, 24 Oct 2023 11:59:31 +0100 Subject: [PATCH] remove unecessary instructions from "contains right Payment Description at Checkout information" 1.When the user tries to print an invoice for an order (that doesn't have any previous invoices), an invoice will be generated automatically. 2.When the user tries to print an invoice for an order without specifing the id of the invoice, he'll get the latest invoice --- spec/system/admin/invoice_print_spec.rb | 12 +----------- 1 file changed, 1 insertion(+), 11 deletions(-) diff --git a/spec/system/admin/invoice_print_spec.rb b/spec/system/admin/invoice_print_spec.rb index 9615fd7419..04290767d3 100644 --- a/spec/system/admin/invoice_print_spec.rb +++ b/spec/system/admin/invoice_print_spec.rb @@ -37,13 +37,7 @@ describe ' end shared_examples "contains right Payment Description at Checkout information" do - let(:url_params) { - if OpenFoodNetwork::FeatureToggle.enabled?(:invoices) - { invoice_id: order.invoices.first.id } - else - {} - end - } + let(:url_params) {{}} let!(:payment_method1) do create(:stripe_sca_payment_method, distributors: [distributor], description: "description1") @@ -54,7 +48,6 @@ describe ' context "with no payment" do it "do not display the payment description information" do - order.invoices.create! login_as_admin visit spree.print_admin_order_path(order, params: url_params) convert_pdf_to_page @@ -68,7 +61,6 @@ describe ' end before do order.save! - order.invoices.create! end it "display the payment description section" do @@ -90,7 +82,6 @@ describe ' payment_method: payment_method2, created_at: 2.days.ago) order.save! - order.invoices.create! end it "display the payment description section and use the one from the completed payment" do @@ -112,7 +103,6 @@ describe ' payment_method: payment_method2, created_at: 1.day.ago) order.save! - order.invoices.create! end it "display the payment description section and use the one from the last payment" do