code-corps / code-corps/code-corps-api

Write test for StripeConnectAccount.update_from_stripe/1

未关闭
#628 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看
主要语言
Elixir
星标
234
派生
82
PR 合并指标
30 天内没有已合并 PR

描述

# Problem

Test should ensure the function returns an {:ok, %StripeConnectAccount{}} with valid data. It should also ensure that the record was actually updated with data from stripe testing.

An additional test should ensure that, if there is no local record with the specified `id_from_stripe`, the response is `{:error, :not_found}`

Lastly, a test should ensure that, if the attributes provided contain invalid data, an `{:error, changeset}` is returned.

### Something we cannot test right now, since we do not have the infrastructure
* If the stripe API raises an error, it returns `{:error, %StripeAPIErrorResponse{}}`

贡献指南

打开贡献指南

调研方向

Locate StripeConnectAccount.update_from_stripe/1 and the surrounding test module, then run the existing account tests first. Done means tests cover valid updates, a missing id_from_stripe returning {:error, :not_found}, and invalid attributes returning an error changeset; Stripe API errors are explicitly out of scope.

由索引模型根据 Issue 内容生成。

评估

技术栈
elixir
领域
backend, testing
Issue 类型
功能
难度
2/5
预计耗时
1-3 小时
活跃度
停滞
描述清晰度
基本清楚
新手友好度
42/100

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。