Skip to content

Commit 61c1132

Browse files
committed
remove unnecessary tests
1 parent 6da5fc6 commit 61c1132

File tree

10 files changed

+10
-72
lines changed

10 files changed

+10
-72
lines changed

models/fixtures/repository.yml

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1694,19 +1694,6 @@
16941694
is_fsck_enabled: true
16951695
close_issues_via_commit_in_any_branch: false
16961696

1697-
-
1698-
id: 59
1699-
owner_id: 2
1700-
owner_name: user2
1701-
lower_name: test_commit_revert
1702-
name: test_commit_revert
1703-
default_branch: main
1704-
is_empty: false
1705-
is_archived: false
1706-
is_private: true
1707-
status: 0
1708-
num_issues: 0
1709-
17101697
-
17111698
id: 60
17121699
owner_id: 40

tests/gitea-repositories-meta/user2/test_commit_revert.git/HEAD

Lines changed: 0 additions & 1 deletion
This file was deleted.

tests/gitea-repositories-meta/user2/test_commit_revert.git/config

Lines changed: 0 additions & 8 deletions
This file was deleted.

tests/gitea-repositories-meta/user2/test_commit_revert.git/packed-refs

Lines changed: 0 additions & 3 deletions
This file was deleted.

tests/gitea-repositories-meta/user2/test_commit_revert.git/refs/heads/main

Lines changed: 0 additions & 1 deletion
This file was deleted.

tests/integration/editor_test.go

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -200,7 +200,7 @@ func TestWebGitCommitEmail(t *testing.T) {
200200

201201
session := loginUser(t, user.Name)
202202

203-
makeReq := func(t *testing.T, link string, params map[string]string, expectedUserName, expectedEmail string) {
203+
makeReq := func(t *testing.T, link string, params map[string]string, expectedUserName, expectedEmail string) *httptest.ResponseRecorder {
204204
lastCommit := getLastCommit(t)
205205
params["_csrf"] = GetUserCSRFToken(t, session)
206206
params["last_commit"] = lastCommit.ID.String()
@@ -220,6 +220,7 @@ func TestWebGitCommitEmail(t *testing.T) {
220220
assert.EqualValues(t, expectedUserName, newCommit.Committer.Name)
221221
assert.EqualValues(t, expectedEmail, newCommit.Committer.Email)
222222
}
223+
return resp
223224
}
224225

225226
uploadFile := func(t *testing.T, name, content string) string {
@@ -261,17 +262,18 @@ func TestWebGitCommitEmail(t *testing.T) {
261262
}, "", "")
262263
})
263264

264-
testWebGit := func(t *testing.T, linkForKeepPrivate string, paramsForKeepPrivate map[string]string, linkForChosenEmail string, paramsForChosenEmail map[string]string) {
265+
testWebGit := func(t *testing.T, linkForKeepPrivate string, paramsForKeepPrivate map[string]string, linkForChosenEmail string, paramsForChosenEmail map[string]string) (resp1, resp2 *httptest.ResponseRecorder) {
265266
t.Run("DefaultEmailKeepPrivate", func(t *testing.T) {
266267
defer tests.PrintCurrentTest(t)()
267268
paramsForKeepPrivate["commit_email"] = ""
268-
makeReq(t, linkForKeepPrivate, paramsForKeepPrivate, "User Two", "[email protected]")
269+
resp1 = makeReq(t, linkForKeepPrivate, paramsForKeepPrivate, "User Two", "[email protected]")
269270
})
270271
t.Run("ChooseEmail", func(t *testing.T) {
271272
defer tests.PrintCurrentTest(t)()
272273
paramsForChosenEmail["commit_email"] = "[email protected]"
273-
makeReq(t, linkForChosenEmail, paramsForChosenEmail, "User Two", "[email protected]")
274+
resp2 = makeReq(t, linkForChosenEmail, paramsForChosenEmail, "User Two", "[email protected]")
274275
})
276+
return resp1, resp2
275277
}
276278

277279
t.Run("Edit", func(t *testing.T) {
@@ -324,10 +326,13 @@ index 0000000000..bbbbbbbbbb
324326
require.NoError(t, err)
325327
commit2, err := gitRepo.GetCommitByPath("patch-file-2.txt")
326328
require.NoError(t, err)
327-
testWebGit(t,
329+
resp1, _ := testWebGit(t,
328330
"/user2/repo1/_cherrypick/"+commit1.ID.String()+"/master", map[string]string{"revert": "true"},
329331
"/user2/repo1/_cherrypick/"+commit2.ID.String()+"/master", map[string]string{"revert": "true"},
330332
)
333+
334+
// By the way, test the "cherrypick" page: a successful revert redirects to the main branch
335+
assert.EqualValues(t, "/user2/repo1/src/branch/master", resp1.Header().Get("Location"))
331336
})
332337
})
333338
}

tests/integration/oauth_test.go

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -691,10 +691,6 @@ func TestOAuth_GrantScopesReadRepositoryFailOrganization(t *testing.T) {
691691
FullRepoName: "user2/commitsonpr",
692692
Private: false,
693693
},
694-
{
695-
FullRepoName: "user2/test_commit_revert",
696-
Private: true,
697-
},
698694
}
699695
assert.Equal(t, reposExpected, reposCaptured)
700696

tests/integration/repo_mergecommit_revert_test.go

Lines changed: 0 additions & 37 deletions
This file was deleted.

0 commit comments

Comments
 (0)