You can not select more than 25 topics Topics must start with a chinese character,a letter or number, can include dashes ('-') and can be up to 35 characters long.

view_test.go 767 B

1234567891011121314151617181920212223242526272829303132
  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. }