You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

34 lines
865 B

  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 integrations
  5. import (
  6. "net/http"
  7. "testing"
  8. "code.gitea.io/gitea/modules/setting"
  9. "github.com/stretchr/testify/assert"
  10. )
  11. func TestSignup(t *testing.T) {
  12. prepareTestEnv(t)
  13. setting.Service.EnableCaptcha = false
  14. req := NewRequestWithValues(t, "POST", "/user/sign_up", map[string]string{
  15. "user_name": "exampleUser",
  16. "email": "exampleUser@example.com",
  17. "password": "examplePassword",
  18. "retype": "examplePassword",
  19. })
  20. resp := MakeRequest(req)
  21. assert.EqualValues(t, http.StatusFound, resp.HeaderCode)
  22. // should be able to view new user's page
  23. req = NewRequest(t, "GET", "/exampleUser")
  24. resp = MakeRequest(req)
  25. assert.EqualValues(t, http.StatusOK, resp.HeaderCode)
  26. }