mirror of
				https://github.com/go-gitea/gitea.git
				synced 2025-10-29 10:57:44 +09:00 
			
		
		
		
	Improve integration test helper functions (#2049)
Set request headers in helper functions, and new helper for requests with string-formatted URLs
This commit is contained in:
		| @@ -32,7 +32,6 @@ func TestChangeDefaultBranch(t *testing.T) { | ||||
| 		"action": "default_branch", | ||||
| 		"branch": "DefaultBranch", | ||||
| 	}) | ||||
| 	req.Header.Add("Content-Type", "application/x-www-form-urlencoded") | ||||
| 	resp = session.MakeRequest(t, req) | ||||
| 	assert.EqualValues(t, http.StatusFound, resp.HeaderCode) | ||||
|  | ||||
| @@ -46,7 +45,6 @@ func TestChangeDefaultBranch(t *testing.T) { | ||||
| 		"action": "default_branch", | ||||
| 		"branch": "does_not_exist", | ||||
| 	}) | ||||
| 	req.Header.Add("Content-Type", "application/x-www-form-urlencoded") | ||||
| 	resp = session.MakeRequest(t, req) | ||||
| 	assert.EqualValues(t, http.StatusNotFound, resp.HeaderCode) | ||||
| } | ||||
|   | ||||
		Reference in New Issue
	
	Block a user