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.

signup_test.go 822 B

1234567891011121314151617181920212223242526272829303132333435
  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 integration
  5. import (
  6. "os"
  7. "testing"
  8. "code.gitea.io/gitea/integrations/internal/utils"
  9. )
  10. var signupFormSample map[string][]string = map[string][]string{
  11. "Name": []string{"tester"},
  12. "Email": []string{"user1@example.com"},
  13. "Passwd": []string{"12345678"},
  14. }
  15. func signup(t *utils.T) error {
  16. return utils.GetAndPost("http://:"+ServerHTTPPort+"/user/sign_up", signupFormSample)
  17. }
  18. func TestSignup(t *testing.T) {
  19. conf := utils.Config{
  20. Program: "../gitea",
  21. WorkDir: "",
  22. Args: []string{"web", "--port", ServerHTTPPort},
  23. LogFile: os.Stderr,
  24. }
  25. if err := utils.New(t, &conf).RunTest(install, signup); err != nil {
  26. t.Fatal(err)
  27. }
  28. }