mirror of https://github.com/go-gitea/gitea.git
fix test
This commit is contained in:
parent
dad9e4a00a
commit
713ab7cab4
|
|
@ -152,7 +152,7 @@ func prepareEditorCommitSubmittedForm[T forms.CommitCommonFormInterface](ctx *co
|
|||
ctx.JSONError(ctx.Tr("repo.editor.fork_failed_to_push_branch", targetBranchName))
|
||||
return nil
|
||||
}
|
||||
// since we have pushed the branch from base branch, so now we need to commit the changes directly
|
||||
// we have pushed the base branch as the new branch, now we need to commit the changes directly to the new branch
|
||||
oldBranchName = targetBranchName
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -407,7 +407,7 @@ func testForkToEditFile(t *testing.T, session *TestSession, user, owner, repo, b
|
|||
assert.NotEmpty(t, lastCommit)
|
||||
|
||||
// change a file in the forked repo
|
||||
req = NewRequestWithValues(t, "POST", formAction,
|
||||
req = NewRequestWithValues(t, "POST", fmt.Sprintf("/%s/%s-1/_edit/%s/%s?from_base_branch=%s", user, repo, branch, filePath, branch),
|
||||
map[string]string{
|
||||
"_csrf": GetUserCSRFToken(t, session),
|
||||
"last_commit": lastCommit,
|
||||
|
|
@ -418,7 +418,11 @@ func testForkToEditFile(t *testing.T, session *TestSession, user, owner, repo, b
|
|||
},
|
||||
)
|
||||
resp = session.MakeRequest(t, req, http.StatusOK)
|
||||
assert.Equal(t, fmt.Sprintf("/%s/%s/compare/%s...%s/%s-1:%s-patch-1", owner, repo, branch, user, repo, user), test.RedirectURL(resp))
|
||||
assert.Equal(t, fmt.Sprintf("/%s/%s/compare/%s...%s/%s-1:%s", owner, repo, branch, user, repo, newBranchName), test.RedirectURL(resp))
|
||||
|
||||
req = NewRequest(t, "GET", fmt.Sprintf("/%s/%s-1/src/branch/%s/%s", user, repo, newBranchName, filePath))
|
||||
resp = session.MakeRequest(t, req, http.StatusOK)
|
||||
assert.Contains(t, resp.Body.String(), "new content in fork")
|
||||
}
|
||||
|
||||
func TestForkToEditFile(t *testing.T) {
|
||||
|
|
|
|||
Loading…
Reference in New Issue