aboutsummaryrefslogtreecommitdiffstats
path: root/integrations/signup_test.go
blob: c317b88d10c05adf22628d5047eaf67f1e740b67 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
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)
	}
}