Skip to content

Commit a21234b

Browse files
committed
update
Signed-off-by: appleboy <[email protected]>
1 parent c2c3e59 commit a21234b

File tree

1 file changed

+5
-7
lines changed

1 file changed

+5
-7
lines changed

tests/integration/api_repo_compare_test.go

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
package integration
55

66
import (
7-
"log"
87
"net/http"
98
"testing"
109

@@ -17,24 +16,23 @@ import (
1716
"github.com/stretchr/testify/assert"
1817
)
1918

20-
func TestAPICompareTag(t *testing.T) {
19+
func TestAPICompareBranches(t *testing.T) {
2120
defer tests.PrepareTestEnv(t)()
2221

2322
user := unittest.AssertExistsAndLoadBean(t, &user_model.User{ID: 2})
2423
// Login as User2.
2524
session := loginUser(t, user.Name)
2625
token := getTokenForLoggedInUser(t, session, auth_model.AccessTokenScopeWriteRepository)
2726

28-
repoName := "repo1"
27+
repoName := "repo20"
2928

30-
req := NewRequestf(t, "GET", "/api/v1/repos/user2/%s/compare/v1.1...master", repoName).
29+
req := NewRequestf(t, "GET", "/api/v1/repos/user2/%s/compare/add-csv...remove-files-b", repoName).
3130
AddTokenAuth(token)
3231
resp := MakeRequest(t, req, http.StatusOK)
3332

3433
var apiResp *api.Compare
3534
DecodeJSON(t, resp, &apiResp)
3635

37-
log.Printf("Total commits: %v", apiResp.TotalCommits)
38-
log.Printf("Commits: %v", apiResp.Commits)
39-
assert.Len(t, apiResp.TotalCommits, 1)
36+
assert.Equal(t, 2, apiResp.TotalCommits)
37+
assert.Len(t, apiResp.Commits, 2)
4038
}

0 commit comments

Comments
 (0)