summaryrefslogtreecommitdiffstats
path: root/integrations/editor_test.go
diff options
context:
space:
mode:
authorEthan Koenig <etk39@cornell.edu>2017-06-24 20:15:42 -0400
committerLunny Xiao <xiaolunwen@gmail.com>2017-06-25 08:15:42 +0800
commitf64c232953d13043b262dc8da55acb3738e58d15 (patch)
tree9f1e88ff351e10be789783254fa51f8fe9c342a7 /integrations/editor_test.go
parent3ffedeab03a80e7345823d118042d17a3e3d9b52 (diff)
downloadgitea-f64c232953d13043b262dc8da55acb3738e58d15.tar.gz
gitea-f64c232953d13043b262dc8da55acb3738e58d15.zip
Improve integration test helper functions (#2049)
Set request headers in helper functions, and new helper for requests with string-formatted URLs
Diffstat (limited to 'integrations/editor_test.go')
-rw-r--r--integrations/editor_test.go5
1 files changed, 0 insertions, 5 deletions
diff --git a/integrations/editor_test.go b/integrations/editor_test.go
index 32eb07fa91..48740414c8 100644
--- a/integrations/editor_test.go
+++ b/integrations/editor_test.go
@@ -34,7 +34,6 @@ func TestCreateFile(t *testing.T) {
"content": "Content",
"commit_choice": "direct",
})
- req.Header.Add("Content-Type", "application/x-www-form-urlencoded")
resp = session.MakeRequest(t, req)
assert.EqualValues(t, http.StatusFound, resp.HeaderCode)
}
@@ -57,7 +56,6 @@ func TestCreateFileOnProtectedBranch(t *testing.T) {
"branchName": "master",
"canPush": "true",
})
- req.Header.Add("Content-Type", "application/x-www-form-urlencoded")
resp = session.MakeRequest(t, req)
assert.EqualValues(t, http.StatusOK, resp.HeaderCode)
// Check if master branch has been locked successfully
@@ -83,7 +81,6 @@ func TestCreateFileOnProtectedBranch(t *testing.T) {
"commit_choice": "direct",
})
- req.Header.Add("Content-Type", "application/x-www-form-urlencoded")
resp = session.MakeRequest(t, req)
assert.EqualValues(t, http.StatusOK, resp.HeaderCode)
// Check body for error message
@@ -113,7 +110,6 @@ func testEditFile(t *testing.T, session *TestSession, user, repo, branch, filePa
"commit_choice": "direct",
},
)
- req.Header.Add("Content-Type", "application/x-www-form-urlencoded")
resp = session.MakeRequest(t, req)
assert.EqualValues(t, http.StatusFound, resp.HeaderCode)
@@ -150,7 +146,6 @@ func testEditFileToNewBranch(t *testing.T, session *TestSession, user, repo, bra
"new_branch_name": targetBranch,
},
)
- req.Header.Add("Content-Type", "application/x-www-form-urlencoded")
resp = session.MakeRequest(t, req)
assert.EqualValues(t, http.StatusFound, resp.HeaderCode)