mirror of
				https://gitee.com/gitea/gitea
				synced 2025-11-04 16:40:24 +08:00 
			
		
		
		
	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
This commit is contained in:
		
							
								
								
									
										35
									
								
								integrations/signup_test.go
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										35
									
								
								integrations/signup_test.go
									
									
									
									
									
										Normal file
									
								
							@@ -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)
 | 
			
		||||
	}
 | 
			
		||||
}
 | 
			
		||||
		Reference in New Issue
	
	Block a user