mirror of
https://github.com/we-promise/sure.git
synced 2026-04-13 09:07:25 +00:00
Agent-Logs-Url: https://github.com/we-promise/sure/sessions/b2581b3a-0e39-4226-bbaa-6fd6dd69e8a6 Co-authored-by: jjmata <187772+jjmata@users.noreply.github.com>
28 lines
743 B
Ruby
28 lines
743 B
Ruby
require "test_helper"
|
|
|
|
class Settings::PaymentsControllerTest < ActionDispatch::IntegrationTest
|
|
setup do
|
|
sign_in @user = users(:empty)
|
|
@family = @user.family
|
|
end
|
|
|
|
test "returns forbidden when family has no stripe_customer_id" do
|
|
assert_nil @family.stripe_customer_id
|
|
|
|
get settings_payment_path
|
|
assert_response :forbidden
|
|
end
|
|
|
|
test "shows payment settings when family has stripe_customer_id" do
|
|
@family.update!(stripe_customer_id: "cus_test123")
|
|
|
|
get settings_payment_path
|
|
assert_response :success
|
|
assert_select(
|
|
"a[href=?]",
|
|
Rails.application.config.x.stripe.one_time_contribution_url,
|
|
text: I18n.t("views.settings.payments.show.one_time_contribution_link_text")
|
|
)
|
|
end
|
|
end
|