Merge pull request #13496 from dacook/fix-link

Fix link to enterprise payment methods tab
This commit is contained in:
Filipe
2025-08-28 19:17:37 +01:00
committed by GitHub
2 changed files with 19 additions and 5 deletions

View File

@@ -15,4 +15,4 @@ angular.module("admin.paymentMethods").controller "StripeController", ($scope, $
permalink = shops.filter((shop) ->
shop.id == $scope.paymentMethod.preferred_enterprise_id
)[0].permalink
"/admin/enterprises/#{permalink}/edit#/payment_methods"
"/admin/enterprises/#{permalink}/edit#/payment_methods_panel"

View File

@@ -73,10 +73,24 @@ RSpec.describe '
select2_select "Missing", from: "payment_method_preferred_enterprise_id"
expect(page).to have_selector "#stripe-account-status .alert-box.error",
text: 'No Stripe account exists for this enterprise.'
connect_one = 'Connect One'
expect(page).to have_link connect_one,
href: edit_admin_enterprise_path(missing_account_enterprise,
anchor: "/payment_methods")
click_link 'Connect One' # opens in new tab
new_window = windows.last
page.within_window new_window do
expect(page).to have_content "Settings: Missing"
# we should be on the Payment Methods tab already
expect(page).to have_content "Use the button to the right to get started."
page.find("a", text: "Connect with Stripe").click # it's not a proper link without href
expect(page).to have_content "connect your Stripe account to the OFN."
href = connect_admin_stripe_accounts_path(enterprise_id: missing_account_enterprise)
expect(page).to have_link "I Agree", href:
# Blocked by capybara. probably don't need to test this.
# click_link "I Agree"
# expect(page).to have_current_path("https://connect.stripe.com/", url: true)
end
new_window.close
select2_select "Revoked", from: "payment_method_preferred_enterprise_id"
expect(page).to have_selector "#stripe-account-status .alert-box.error",