From c5c1d593ad4daf2a7846d93a99a1f3eb31360629 Mon Sep 17 00:00:00 2001 From: Earl Warren Date: Sun, 3 Nov 2024 09:58:58 +0100 Subject: [PATCH] chore(cleanup): remove unused TestCreateFile Since CreateDeclarativeRepoWithOptions it is more convenient to create a file by providing arguments. --- tests/integration/editor_test.go | 29 ----------------------------- 1 file changed, 29 deletions(-) diff --git a/tests/integration/editor_test.go b/tests/integration/editor_test.go index 4ed6485717..4b35dac1bf 100644 --- a/tests/integration/editor_test.go +++ b/tests/integration/editor_test.go @@ -27,35 +27,6 @@ import ( "github.com/stretchr/testify/require" ) -func TestCreateFile(t *testing.T) { - onGiteaRun(t, func(t *testing.T, u *url.URL) { - session := loginUser(t, "user2") - testCreateFile(t, session, "user2", "repo1", "master", "test.txt", "Content") - }) -} - -func testCreateFile(t *testing.T, session *TestSession, user, repo, branch, filePath, content string) *httptest.ResponseRecorder { - // Request editor page - newURL := fmt.Sprintf("/%s/%s/_new/%s/", user, repo, branch) - req := NewRequest(t, "GET", newURL) - resp := session.MakeRequest(t, req, http.StatusOK) - - doc := NewHTMLParser(t, resp.Body) - lastCommit := doc.GetInputValueByName("last_commit") - assert.NotEmpty(t, lastCommit) - - // Save new file to master branch - req = NewRequestWithValues(t, "POST", newURL, map[string]string{ - "_csrf": doc.GetCSRF(), - "last_commit": lastCommit, - "tree_path": filePath, - "content": content, - "commit_choice": "direct", - "commit_mail_id": "3", - }) - return session.MakeRequest(t, req, http.StatusSeeOther) -} - func TestCreateFileOnProtectedBranch(t *testing.T) { onGiteaRun(t, func(t *testing.T, u *url.URL) { session := loginUser(t, "user2")