diff --git a/tests/integration/links_test.go b/tests/integration/links_test.go index 4e91b81832..3182dc1716 100644 --- a/tests/integration/links_test.go +++ b/tests/integration/links_test.go @@ -152,7 +152,7 @@ func testLinksAsUser(userName string, t *testing.T) { DecodeJSON(t, respAPI, &apiRepos) repoLinks := []string{ - "", + "/code", "/issues", "/pulls", "/commits/branch/master", diff --git a/tests/integration/org_test.go b/tests/integration/org_test.go index ef4ef2bb9b..9a7c947b83 100644 --- a/tests/integration/org_test.go +++ b/tests/integration/org_test.go @@ -63,7 +63,7 @@ func TestLimitedOrg(t *testing.T) { session := loginUser(t, "user2") req = NewRequest(t, "GET", "/limited_org") session.MakeRequest(t, req, http.StatusOK) - req = NewRequest(t, "GET", "/limited_org/public_repo_on_limited_org") + req = NewRequest(t, "GET", "/limited_org/public_repo_on_limited_org/code") session.MakeRequest(t, req, http.StatusOK) req = NewRequest(t, "GET", "/limited_org/private_repo_on_limited_org") session.MakeRequest(t, req, http.StatusNotFound) @@ -72,7 +72,7 @@ func TestLimitedOrg(t *testing.T) { session = loginUser(t, "user1") req = NewRequest(t, "GET", "/limited_org") session.MakeRequest(t, req, http.StatusOK) - req = NewRequest(t, "GET", "/limited_org/public_repo_on_limited_org") + req = NewRequest(t, "GET", "/limited_org/public_repo_on_limited_org/code") session.MakeRequest(t, req, http.StatusOK) req = NewRequest(t, "GET", "/limited_org/private_repo_on_limited_org") session.MakeRequest(t, req, http.StatusOK) @@ -102,7 +102,7 @@ func TestPrivateOrg(t *testing.T) { session = loginUser(t, "user4") req = NewRequest(t, "GET", "/privated_org") session.MakeRequest(t, req, http.StatusNotFound) - req = NewRequest(t, "GET", "/privated_org/public_repo_on_private_org") // colab of this repo + req = NewRequest(t, "GET", "/privated_org/public_repo_on_private_org/code") // colab of this repo session.MakeRequest(t, req, http.StatusOK) req = NewRequest(t, "GET", "/privated_org/private_repo_on_private_org") session.MakeRequest(t, req, http.StatusNotFound) @@ -111,9 +111,9 @@ func TestPrivateOrg(t *testing.T) { session = loginUser(t, "user1") req = NewRequest(t, "GET", "/privated_org") session.MakeRequest(t, req, http.StatusOK) - req = NewRequest(t, "GET", "/privated_org/public_repo_on_private_org") + req = NewRequest(t, "GET", "/privated_org/public_repo_on_private_org/code") session.MakeRequest(t, req, http.StatusOK) - req = NewRequest(t, "GET", "/privated_org/private_repo_on_private_org") + req = NewRequest(t, "GET", "/privated_org/private_repo_on_private_org/code") session.MakeRequest(t, req, http.StatusOK) } diff --git a/tests/integration/repo_fork_test.go b/tests/integration/repo_fork_test.go index 6b8ae432dd..796b82a30d 100644 --- a/tests/integration/repo_fork_test.go +++ b/tests/integration/repo_fork_test.go @@ -69,7 +69,9 @@ func TestRepoForkToOrg(t *testing.T) { // Check that no more forking is allowed as user2 owns repository // and org3 organization that owner user2 is also now has forked this repository req := NewRequest(t, "GET", "/user2/repo1") - resp := session.MakeRequest(t, req, http.StatusOK) + resp := session.MakeRequest(t, req, http.StatusMovedPermanently) + req = NewRequest(t, "GET", resp.Result().Header.Get("Location")) + resp = MakeRequest(t, req, http.StatusOK) htmlDoc := NewHTMLParser(t, resp.Body) _, exists := htmlDoc.doc.Find(`a.ui.button[href*="/fork"]`).Attr("href") assert.False(t, exists, "Forking should not be allowed anymore") diff --git a/tests/integration/repo_test.go b/tests/integration/repo_test.go index d8919dbb25..97044e5a84 100644 --- a/tests/integration/repo_test.go +++ b/tests/integration/repo_test.go @@ -25,7 +25,7 @@ func TestViewRepo(t *testing.T) { session := loginUser(t, "user2") req := NewRequest(t, "GET", "/user2/repo1") - resp := session.MakeRequest(t, req, http.StatusOK) + resp := session.MakeRequest(t, req, http.StatusMovedPermanently) link := resp.Result().Header.Get("Location") req = NewRequest(t, "GET", link)