From 49df677c475d6a20575b99b5af8323f65937dadb Mon Sep 17 00:00:00 2001 From: Ethan Koenig Date: Sat, 29 Jul 2017 18:13:33 -0700 Subject: Check for access in /repositories/:id (#2227) * Check for access in /repositories/:id * Integration test --- integrations/api_repo_test.go | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'integrations') diff --git a/integrations/api_repo_test.go b/integrations/api_repo_test.go index e89a6359ae..d5b1676d6e 100644 --- a/integrations/api_repo_test.go +++ b/integrations/api_repo_test.go @@ -84,3 +84,11 @@ func TestAPIOrgRepos(t *testing.T) { assert.False(t, repo.Private) } } + +func TestAPIGetRepoByIDUnauthorized(t *testing.T) { + prepareTestEnv(t) + user := models.AssertExistsAndLoadBean(t, &models.User{ID: 4}).(*models.User) + sess := loginUser(t, user.Name) + req := NewRequestf(t, "GET", "/api/v1/repositories/2") + sess.MakeRequest(t, req, http.StatusNotFound) +} -- cgit v1.2.3