mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-02-26 01:33:22 +00:00
Move spec to end of file so we can extend this case with refunds and cancelations
This commit is contained in:
@@ -14,32 +14,6 @@ feature '
|
||||
create(:stripe_sca_payment_method, distributors: [order.distributor])
|
||||
end
|
||||
|
||||
context "with a payment using a StripeSCA payment method" do
|
||||
before do
|
||||
order.payments << create(:payment, payment_method: stripe_payment_method, order: order)
|
||||
end
|
||||
|
||||
it "renders the payment details" do
|
||||
login_as_admin_and_visit spree.admin_order_payments_path order
|
||||
|
||||
page.click_link("StripeSCA")
|
||||
expect(page).to have_content order.payments.last.source.last_digits
|
||||
end
|
||||
|
||||
context "with a deleted credit card" do
|
||||
before do
|
||||
order.payments.last.update source: nil
|
||||
end
|
||||
|
||||
it "renders the payment details" do
|
||||
login_as_admin_and_visit spree.admin_order_payments_path order
|
||||
|
||||
page.click_link("StripeSCA")
|
||||
expect(page).to have_content order.payments.last.amount
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
context "making a new Stripe payment", js: true do
|
||||
let!(:stripe_account) do
|
||||
create(:stripe_account, enterprise: order.distributor, stripe_user_id: "abc123")
|
||||
@@ -130,4 +104,30 @@ feature '
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
context "with a payment using a StripeSCA payment method" do
|
||||
before do
|
||||
order.payments << create(:payment, payment_method: stripe_payment_method, order: order)
|
||||
end
|
||||
|
||||
it "renders the payment details" do
|
||||
login_as_admin_and_visit spree.admin_order_payments_path order
|
||||
|
||||
page.click_link("StripeSCA")
|
||||
expect(page).to have_content order.payments.last.source.last_digits
|
||||
end
|
||||
|
||||
context "with a deleted credit card" do
|
||||
before do
|
||||
order.payments.last.update source: nil
|
||||
end
|
||||
|
||||
it "renders the payment details" do
|
||||
login_as_admin_and_visit spree.admin_order_payments_path order
|
||||
|
||||
page.click_link("StripeSCA")
|
||||
expect(page).to have_content order.payments.last.amount
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user