Tighten Stripe payment link lookup tests

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:
copilot-swe-agent[bot]
2026-04-04 12:35:11 +00:00
committed by GitHub
parent f1f1bc91cc
commit 7a9d207626
4 changed files with 16 additions and 4 deletions

View File

@@ -15,8 +15,11 @@ class Settings::PaymentsControllerTest < ActionDispatch::IntegrationTest
test "shows payment settings when family has stripe_customer_id" do
@family.update!(stripe_customer_id: "cus_test123")
ENV.stubs(:[]).with("STRIPE_PAYMENT_LINK_ID").returns("plink_test123")
stripe = mock
stripe.expects(:payment_link_url).returns("https://buy.stripe.com/test_payment_link")
stripe.expects(:payment_link_url)
.with(payment_link_id: "plink_test123")
.returns("https://buy.stripe.com/test_payment_link")
Provider::Registry.stubs(:get_provider).with(:stripe).returns(stripe)
get settings_payment_path
@@ -30,8 +33,11 @@ class Settings::PaymentsControllerTest < ActionDispatch::IntegrationTest
test "shows payment settings without contribution link when payment link is unavailable" do
@family.update!(stripe_customer_id: "cus_test123")
ENV.stubs(:[]).with("STRIPE_PAYMENT_LINK_ID").returns("plink_test123")
stripe = mock
stripe.expects(:payment_link_url).returns(nil)
stripe.expects(:payment_link_url)
.with(payment_link_id: "plink_test123")
.returns(nil)
Provider::Registry.stubs(:get_provider).with(:stripe).returns(stripe)
get settings_payment_path