Skip to content

Commit 61ab7ac

Browse files
committed
Fix test
1 parent 8b68a42 commit 61ab7ac

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

tests/integration/api_search_code_test.go

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -26,21 +26,21 @@ func TestAPISearchCodeNotLogin(t *testing.T) {
2626

2727
var apiCodeSearchResults api.CodeSearchResults
2828
DecodeJSON(t, resp, &apiCodeSearchResults)
29-
assert.Equal(t, int64(4), apiCodeSearchResults.TotalCount)
30-
assert.Len(t, apiCodeSearchResults.Items, 4)
29+
assert.Equal(t, int64(1), apiCodeSearchResults.TotalCount)
30+
assert.Len(t, apiCodeSearchResults.Items, 1)
3131
assert.Equal(t, "README.md", apiCodeSearchResults.Items[0].Name)
3232
assert.Equal(t, "README.md", apiCodeSearchResults.Items[0].Path)
3333
assert.Equal(t, "Markdown", apiCodeSearchResults.Items[0].Language)
3434
assert.Len(t, apiCodeSearchResults.Items[0].Lines, 2)
3535
assert.Equal(t, "\n", apiCodeSearchResults.Items[0].Lines[0].RawContent)
3636
assert.Equal(t, "Description for repo1", apiCodeSearchResults.Items[0].Lines[1].RawContent)
3737

38-
assert.Equal(t, setting.AppURL+"api/v1/repos/user2/git_hooks_test/contents/README.md?ref=65f1bf27bc3bf70f64657658635e66094edbcb4d", apiCodeSearchResults.Items[0].URL)
39-
assert.Equal(t, setting.AppURL+"user2/git_hooks_test/blob/65f1bf27bc3bf70f64657658635e66094edbcb4d/README.md", apiCodeSearchResults.Items[0].HTMLURL)
38+
assert.Equal(t, setting.AppURL+"api/v1/repos/user2/repo1/contents/README.md?ref=65f1bf27bc3bf70f64657658635e66094edbcb4d", apiCodeSearchResults.Items[0].URL)
39+
assert.Equal(t, setting.AppURL+"user2/repo1/blob/65f1bf27bc3bf70f64657658635e66094edbcb4d/README.md", apiCodeSearchResults.Items[0].HTMLURL)
4040

41-
assert.Equal(t, int64(37), apiCodeSearchResults.Items[0].Repository.ID)
41+
assert.Equal(t, int64(1), apiCodeSearchResults.Items[0].Repository.ID)
4242

4343
assert.Len(t, apiCodeSearchResults.Languages, 1)
4444
assert.Equal(t, "Markdown", apiCodeSearchResults.Languages[0].Language)
45-
assert.Equal(t, 4, apiCodeSearchResults.Languages[0].Count)
45+
assert.Equal(t, 1, apiCodeSearchResults.Languages[0].Count)
4646
}

0 commit comments

Comments
 (0)