mirror of
https://github.com/go-gitea/gitea
synced 2025-07-22 18:28:37 +00:00
Enable testifylint rules (#34075)
enable testifylint rules disabled in: https://github.com/go-gitea/gitea/pull/34054
This commit is contained in:
@@ -25,7 +25,7 @@ func TestTopicSearch(t *testing.T) {
|
||||
res := MakeRequest(t, NewRequest(t, "GET", searchURL.String()), http.StatusOK)
|
||||
DecodeJSON(t, res, &topics)
|
||||
assert.Len(t, topics.TopicNames, 6)
|
||||
assert.EqualValues(t, "6", res.Header().Get("x-total-count"))
|
||||
assert.Equal(t, "6", res.Header().Get("x-total-count"))
|
||||
|
||||
// pagination search topics
|
||||
topics.TopicNames = nil
|
||||
@@ -35,7 +35,7 @@ func TestTopicSearch(t *testing.T) {
|
||||
res = MakeRequest(t, NewRequest(t, "GET", searchURL.String()), http.StatusOK)
|
||||
DecodeJSON(t, res, &topics)
|
||||
assert.Len(t, topics.TopicNames, 4)
|
||||
assert.EqualValues(t, "6", res.Header().Get("x-total-count"))
|
||||
assert.Equal(t, "6", res.Header().Get("x-total-count"))
|
||||
|
||||
// second page
|
||||
topics.TopicNames = nil
|
||||
@@ -45,7 +45,7 @@ func TestTopicSearch(t *testing.T) {
|
||||
res = MakeRequest(t, NewRequest(t, "GET", searchURL.String()), http.StatusOK)
|
||||
DecodeJSON(t, res, &topics)
|
||||
assert.Len(t, topics.TopicNames, 2)
|
||||
assert.EqualValues(t, "6", res.Header().Get("x-total-count"))
|
||||
assert.Equal(t, "6", res.Header().Get("x-total-count"))
|
||||
|
||||
// add keyword search
|
||||
topics.TopicNames = nil
|
||||
@@ -63,7 +63,7 @@ func TestTopicSearch(t *testing.T) {
|
||||
DecodeJSON(t, res, &topics)
|
||||
if assert.Len(t, topics.TopicNames, 1) {
|
||||
assert.EqualValues(t, 2, topics.TopicNames[0].ID)
|
||||
assert.EqualValues(t, "database", topics.TopicNames[0].Name)
|
||||
assert.EqualValues(t, 1, topics.TopicNames[0].RepoCount)
|
||||
assert.Equal(t, "database", topics.TopicNames[0].Name)
|
||||
assert.Equal(t, 1, topics.TopicNames[0].RepoCount)
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user