mirror of
https://github.com/go-gitea/gitea.git
synced 2026-09-08 22:13:26 +09:00
Refactor integration test DecodeJSON calls to use generic return value (#37432)
Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: wxiaoguang <2114189+wxiaoguang@users.noreply.github.com> Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
This commit is contained in:
co-authored by
copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
wxiaoguang
wxiaoguang
parent
99cd4f6b22
commit
2671b997f2
@@ -50,8 +50,7 @@ func TestAPIWatch(t *testing.T) {
|
||||
|
||||
assert.Equal(t, "1", resp.Header().Get("X-Total-Count"))
|
||||
|
||||
var repos []api.Repository
|
||||
DecodeJSON(t, resp, &repos)
|
||||
repos := DecodeJSON(t, resp, []api.Repository{})
|
||||
assert.Len(t, repos, 1)
|
||||
assert.Equal(t, repo, repos[0].FullName)
|
||||
})
|
||||
@@ -65,8 +64,7 @@ func TestAPIWatch(t *testing.T) {
|
||||
|
||||
assert.Equal(t, "1", resp.Header().Get("X-Total-Count"))
|
||||
|
||||
var repos []api.Repository
|
||||
DecodeJSON(t, resp, &repos)
|
||||
repos := DecodeJSON(t, resp, []api.Repository{})
|
||||
assert.Len(t, repos, 1)
|
||||
assert.Equal(t, repo, repos[0].FullName)
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user