Skip to content

Commit

Permalink
remove unecessary instructions from "contains right Payment Descripti…
Browse files Browse the repository at this point in the history
…on 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
  • Loading branch information
abdellani committed Oct 24, 2023
1 parent 5ea5218 commit 615bfda
Showing 1 changed file with 1 addition and 11 deletions.
12 changes: 1 addition & 11 deletions spec/system/admin/invoice_print_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -37,13 +37,7 @@
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")
Expand All @@ -54,7 +48,6 @@

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
Expand All @@ -68,7 +61,6 @@
end
before do
order.save!
order.invoices.create!
end

it "display the payment description section" do
Expand All @@ -90,7 +82,6 @@
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
Expand All @@ -112,7 +103,6 @@
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
Expand Down

0 comments on commit 615bfda

Please sign in to comment.