mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-02-27 01:43:22 +00:00
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
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user