diff options
author | Ethan Koenig <etk39@cornell.edu> | 2017-06-17 00:49:45 -0400 |
---|---|---|
committer | Lunny Xiao <xiaolunwen@gmail.com> | 2017-06-17 12:49:45 +0800 |
commit | ce9b86082c4824917023b1bb480648d0cc56dd04 (patch) | |
tree | ba28673c955d009492557f54953857165e2f8da8 /integrations/signup_test.go | |
parent | a3868ef5367315f52334b81819a412cad820f5eb (diff) | |
download | gitea-ce9b86082c4824917023b1bb480648d0cc56dd04.tar.gz gitea-ce9b86082c4824917023b1bb480648d0cc56dd04.zip |
Consolidate boilerplate in integration tests (#1979)
Diffstat (limited to 'integrations/signup_test.go')
-rw-r--r-- | integrations/signup_test.go | 16 |
1 files changed, 6 insertions, 10 deletions
diff --git a/integrations/signup_test.go b/integrations/signup_test.go index 4bb84c1a20..6d4768ec12 100644 --- a/integrations/signup_test.go +++ b/integrations/signup_test.go @@ -5,9 +5,7 @@ package integrations import ( - "bytes" "net/http" - "net/url" "testing" "code.gitea.io/gitea/modules/setting" @@ -20,14 +18,12 @@ func TestSignup(t *testing.T) { setting.Service.EnableCaptcha = false - req := NewRequestBody(t, "POST", "/user/sign_up", - bytes.NewBufferString(url.Values{ - "user_name": []string{"exampleUser"}, - "email": []string{"exampleUser@example.com"}, - "password": []string{"examplePassword"}, - "retype": []string{"examplePassword"}, - }.Encode()), - ) + req := NewRequestWithValues(t, "POST", "/user/sign_up", map[string]string{ + "user_name": "exampleUser", + "email": "exampleUser@example.com", + "password": "examplePassword", + "retype": "examplePassword", + }) req.Header.Add("Content-Type", "application/x-www-form-urlencoded") resp := MakeRequest(req) assert.EqualValues(t, http.StatusFound, resp.HeaderCode) |