Fork to maintain patches against the official gitea for https://code.ceondo.com https://github.com/go-gitea/gitea

view_test.go 767B

123456789101112131415161718192021222324252627282930313233
  1. // Copyright 2017 The Gitea Authors. All rights reserved.
  2. // Use of this source code is governed by a MIT-style
  3. // license that can be found in the LICENSE file.
  4. package integrations
  5. import (
  6. "net/http"
  7. "testing"
  8. "code.gitea.io/gitea/models"
  9. "github.com/stretchr/testify/assert"
  10. )
  11. func TestViewRepo(t *testing.T) {
  12. assert.NoError(t, models.LoadFixtures())
  13. req, err := http.NewRequest("GET", "/user1/repo1", nil)
  14. assert.NoError(t, err)
  15. resp := MakeRequest(req)
  16. assert.EqualValues(t, http.StatusOK, resp.HeaderCode)
  17. }
  18. func TestViewUser(t *testing.T) {
  19. assert.NoError(t, models.LoadFixtures())
  20. req, err := http.NewRequest("GET", "/user1", nil)
  21. assert.NoError(t, err)
  22. resp := MakeRequest(req)
  23. assert.EqualValues(t, http.StatusOK, resp.HeaderCode)
  24. }