Skip to content

Commit

Permalink
Add integration test case
Browse files Browse the repository at this point in the history
  • Loading branch information
qwerty287 committed Dec 19, 2021
1 parent 7643f47 commit f695dc6
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions integrations/api_repo_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -536,6 +536,10 @@ func TestAPIAcceptTransfer(t *testing.T) {
req := NewRequest(t, "POST", fmt.Sprintf("/api/v1/repos/%s/%s/transfer/reject?token=%s", repo.OwnerName, repo.Name, token))
session.MakeRequest(t, req, http.StatusForbidden)

// try to accept repo that's not marked as transferred
req = NewRequest(t, "POST", fmt.Sprintf("/api/v1/repos/%s/%s/transfer/accept?token=%s", "user2","repo1" , token))
session.MakeRequest(t, req, http.StatusNotFound)

// accept transfer
session = loginUser(t, "user4")
token = getTokenForLoggedInUser(t, session)
Expand All @@ -558,6 +562,10 @@ func TestAPIRejectTransfer(t *testing.T) {
req := NewRequest(t, "POST", fmt.Sprintf("/api/v1/repos/%s/%s/transfer/reject?token=%s", repo.OwnerName, repo.Name, token))
session.MakeRequest(t, req, http.StatusForbidden)

// try to reject repo that's not marked as transferred
req = NewRequest(t, "POST", fmt.Sprintf("/api/v1/repos/%s/%s/transfer/reject?token=%s", "user2","repo1" , token))
session.MakeRequest(t, req, http.StatusNotFound)

// reject transfer
session = loginUser(t, "user4")
token = getTokenForLoggedInUser(t, session)
Expand Down

0 comments on commit f695dc6

Please sign in to comment.