mirror of
https://github.com/we-promise/sure.git
synced 2026-04-17 11:04:14 +00:00
Skip Stripe lookup when payment link id is missing
Agent-Logs-Url: https://github.com/we-promise/sure/sessions/efba0c75-5f82-41a1-b618-532d38e222da Co-authored-by: jjmata <187772+jjmata@users.noreply.github.com>
This commit is contained in:
committed by
GitHub
parent
7a9d207626
commit
2a3e95efc9
@@ -49,4 +49,19 @@ class Settings::PaymentsControllerTest < ActionDispatch::IntegrationTest
|
||||
)
|
||||
assert_select "p", text: I18n.t("views.settings.payments.show.payment_via_stripe")
|
||||
end
|
||||
|
||||
test "shows payment settings without contribution link when payment link id is missing" do
|
||||
@family.update!(stripe_customer_id: "cus_test123")
|
||||
ENV.stubs(:[]).with("STRIPE_PAYMENT_LINK_ID").returns(nil)
|
||||
Provider::Registry.expects(:get_provider).with(:stripe).never
|
||||
|
||||
get settings_payment_path
|
||||
assert_response :success
|
||||
assert_select(
|
||||
"a",
|
||||
text: I18n.t("views.settings.payments.show.one_time_contribution_link_text"),
|
||||
count: 0
|
||||
)
|
||||
assert_select "p", text: I18n.t("views.settings.payments.show.payment_via_stripe")
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user