summaryrefslogtreecommitdiffstats
path: root/integrations/view_test.go
diff options
context:
space:
mode:
authorLunny Xiao <xiaolunwen@gmail.com>2017-04-28 21:23:28 +0800
committerGitHub <noreply@github.com>2017-04-28 21:23:28 +0800
commitfca7ddc6ea5ceae298b0a4f33d0b82a2f1ccc06e (patch)
treec367ef79ac6f3d8c9d18e129395ba0c6a822d535 /integrations/view_test.go
parent431b26f6d7d5b2d4700b4a65f1a81094c36a9fae (diff)
downloadgitea-fca7ddc6ea5ceae298b0a4f33d0b82a2f1ccc06e.tar.gz
gitea-fca7ddc6ea5ceae298b0a4f33d0b82a2f1ccc06e.zip
improve integration test to resue models/fixtures and store git repos with tests (#1627)
* improve integration test to resue models/fixtures and store git repos with source * use gitea-integration-meta dir instead .tar.gz and cleanup every before every test * fix import package name
Diffstat (limited to 'integrations/view_test.go')
-rw-r--r--integrations/view_test.go10
1 files changed, 4 insertions, 6 deletions
diff --git a/integrations/view_test.go b/integrations/view_test.go
index 1314fe3832..26d8348afe 100644
--- a/integrations/view_test.go
+++ b/integrations/view_test.go
@@ -8,24 +8,22 @@ import (
"net/http"
"testing"
- "code.gitea.io/gitea/models"
-
"github.com/stretchr/testify/assert"
)
func TestViewRepo(t *testing.T) {
- assert.NoError(t, models.LoadFixtures())
+ prepareTestEnv(t)
- req, err := http.NewRequest("GET", "/user1/repo1", nil)
+ req, err := http.NewRequest("GET", "/user2/repo1", nil)
assert.NoError(t, err)
resp := MakeRequest(req)
assert.EqualValues(t, http.StatusOK, resp.HeaderCode)
}
func TestViewUser(t *testing.T) {
- assert.NoError(t, models.LoadFixtures())
+ prepareTestEnv(t)
- req, err := http.NewRequest("GET", "/user1", nil)
+ req, err := http.NewRequest("GET", "/user2", nil)
assert.NoError(t, err)
resp := MakeRequest(req)
assert.EqualValues(t, http.StatusOK, resp.HeaderCode)