summaryrefslogtreecommitdiffstats
path: root/integrations/repo_test.go
diff options
context:
space:
mode:
Diffstat (limited to 'integrations/repo_test.go')
-rw-r--r--integrations/repo_test.go26
1 files changed, 26 insertions, 0 deletions
diff --git a/integrations/repo_test.go b/integrations/repo_test.go
index 130418f3fd..a602d96f79 100644
--- a/integrations/repo_test.go
+++ b/integrations/repo_test.go
@@ -17,4 +17,30 @@ func TestViewRepo(t *testing.T) {
req := NewRequest(t, "GET", "/user2/repo1")
resp := MakeRequest(req)
assert.EqualValues(t, http.StatusOK, resp.HeaderCode)
+
+ req = NewRequest(t, "GET", "/user3/repo3")
+ resp = MakeRequest(req)
+ assert.EqualValues(t, http.StatusNotFound, resp.HeaderCode)
+
+ session := loginUser(t, "user1", "password")
+ resp = session.MakeRequest(t, req)
+ assert.EqualValues(t, http.StatusNotFound, resp.HeaderCode)
+}
+
+func TestViewRepo2(t *testing.T) {
+ prepareTestEnv(t)
+
+ req := NewRequest(t, "GET", "/user3/repo3")
+ session := loginUser(t, "user2", "password")
+ resp := session.MakeRequest(t, req)
+ assert.EqualValues(t, http.StatusOK, resp.HeaderCode)
+}
+
+func TestViewRepo3(t *testing.T) {
+ prepareTestEnv(t)
+
+ req := NewRequest(t, "GET", "/user3/repo3")
+ session := loginUser(t, "user3", "password")
+ resp := session.MakeRequest(t, req)
+ assert.EqualValues(t, http.StatusOK, resp.HeaderCode)
}