为含可选分组写入保护参数的方法添加用例调用适配,不改变业务授权逻辑或中文提示。后端全量静态检查通过,未执行回归用例或实机验收。
This commit is contained in:
1 parent
7b6891fdbb
commit
417481f05c
1 file changed
+6
-2
@@ -196,8 +196,12 @@ func TestRepositoryRebindsDisabledEmailWithFreshVerification(t *testing.T) {
|
|||||||
bind := repo.Bind
|
bind := repo.Bind
|
||||||
verify := repo.Verify
|
verify := repo.Verify
|
||||||
if replacement {
|
if replacement {
|
||||||
bind = repo.BeginReplacement
|
bind = func(request BindRequest) (*models.ExternalEmail, error) {
|
||||||
verify = repo.VerifyReplacement
|
return repo.BeginReplacement(request)
|
||||||
|
}
|
||||||
|
verify = func(userID, id int) error {
|
||||||
|
return repo.VerifyReplacement(userID, id)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
request := BindRequest{UserID: 1, Email: "OWNER@example.com", Type: models.ExternalEmailTypePrimary}
|
request := BindRequest{UserID: 1, Email: "OWNER@example.com", Type: models.ExternalEmailTypePrimary}
|
||||||
if _, err := bind(request); err != ErrBindingExists {
|
if _, err := bind(request); err != ErrBindingExists {
|
||||||
|
|||||||
Reference in new issue
Block a user