2017-04-28 21:33:25 -07:00
|
|
|
// Copyright 2017 The Gitea Authors. All rights reserved.
|
|
|
|
// Use of this source code is governed by a MIT-style
|
|
|
|
// license that can be found in the LICENSE file.
|
|
|
|
|
|
|
|
package integrations
|
|
|
|
|
|
|
|
import (
|
|
|
|
"net/http"
|
|
|
|
"testing"
|
|
|
|
)
|
|
|
|
|
|
|
|
func TestAPIUserReposNotLogin(t *testing.T) {
|
2017-06-25 02:34:30 -07:00
|
|
|
prepareTestEnv(t)
|
2017-04-28 21:33:25 -07:00
|
|
|
|
2017-06-09 17:41:36 -07:00
|
|
|
req := NewRequest(t, "GET", "/api/v1/users/user2/repos")
|
2017-07-07 12:36:47 -07:00
|
|
|
MakeRequest(t, req, http.StatusOK)
|
2017-04-28 21:33:25 -07:00
|
|
|
}
|
2017-04-29 22:08:09 -07:00
|
|
|
|
|
|
|
func TestAPISearchRepoNotLogin(t *testing.T) {
|
2017-06-25 02:34:30 -07:00
|
|
|
prepareTestEnv(t)
|
2017-04-29 22:08:09 -07:00
|
|
|
|
2017-06-09 17:41:36 -07:00
|
|
|
req := NewRequest(t, "GET", "/api/v1/repos/search?q=Test")
|
2017-07-07 12:36:47 -07:00
|
|
|
MakeRequest(t, req, http.StatusOK)
|
2017-04-29 22:08:09 -07:00
|
|
|
}
|