diff options
author | Mura Li <typeless@users.noreply.github.com> | 2017-03-11 22:30:29 +0800 |
---|---|---|
committer | Lunny Xiao <xiaolunwen@gmail.com> | 2017-03-11 22:30:29 +0800 |
commit | bdcc1a23e0525da67d722c65bcdbb7e3fa7cfdf8 (patch) | |
tree | f3e5c488d9da2da2a17c215dca0279cd3145837a /integrations/signup_test.go | |
parent | 8a98a25d8e538d7ef026147b14b937beba2b1056 (diff) | |
download | gitea-bdcc1a23e0525da67d722c65bcdbb7e3fa7cfdf8.tar.gz gitea-bdcc1a23e0525da67d722c65bcdbb7e3fa7cfdf8.zip |
Add integration test for signup (#1135)
* Add integration test for signup
* Remove unused functions
* Refactoring
* Add repo_create_test.go
* Rollback the incomplete repo create test
* Comply with linter requirements and simplify the code a little bit
Diffstat (limited to 'integrations/signup_test.go')
-rw-r--r-- | integrations/signup_test.go | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/integrations/signup_test.go b/integrations/signup_test.go new file mode 100644 index 0000000000..c317b88d10 --- /dev/null +++ b/integrations/signup_test.go @@ -0,0 +1,35 @@ +// 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 integration + +import ( + "os" + "testing" + + "code.gitea.io/gitea/integrations/internal/utils" +) + +var signupFormSample map[string][]string = map[string][]string{ + "Name": []string{"tester"}, + "Email": []string{"user1@example.com"}, + "Passwd": []string{"12345678"}, +} + +func signup(t *utils.T) error { + return utils.GetAndPost("http://:"+ServerHTTPPort+"/user/sign_up", signupFormSample) +} + +func TestSignup(t *testing.T) { + conf := utils.Config{ + Program: "../gitea", + WorkDir: "", + Args: []string{"web", "--port", ServerHTTPPort}, + LogFile: os.Stderr, + } + + if err := utils.New(t, &conf).RunTest(install, signup); err != nil { + t.Fatal(err) + } +} |