Move spec to end of file so we can extend this case with refunds and cancelations

This commit is contained in:
Luis Ramos
2020-10-06 17:51:43 +01:00
parent a6ed003cb9
commit bce81d27dd

View File

@@ -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