summaryrefslogtreecommitdiffstats
path: root/integrations/editor_test.go
diff options
context:
space:
mode:
Diffstat (limited to 'integrations/editor_test.go')
-rw-r--r--integrations/editor_test.go13
1 files changed, 4 insertions, 9 deletions
diff --git a/integrations/editor_test.go b/integrations/editor_test.go
index cc94edfd3f..453b38491d 100644
--- a/integrations/editor_test.go
+++ b/integrations/editor_test.go
@@ -89,10 +89,7 @@ func TestCreateFileOnProtectedBranch(t *testing.T) {
}
-func testEditFile(t *testing.T, session *TestSession, user, repo, branch, filePath string) *TestResponse {
-
- newContent := "Hello, World (Edited)\n"
-
+func testEditFile(t *testing.T, session *TestSession, user, repo, branch, filePath, newContent string) *TestResponse {
// Get to the 'edit this file' page
req := NewRequest(t, "GET", path.Join(user, repo, "_edit", branch, filePath))
resp := session.MakeRequest(t, req, http.StatusOK)
@@ -121,9 +118,7 @@ func testEditFile(t *testing.T, session *TestSession, user, repo, branch, filePa
return resp
}
-func testEditFileToNewBranch(t *testing.T, session *TestSession, user, repo, branch, targetBranch, filePath string) *TestResponse {
-
- newContent := "Hello, World (Edited)\n"
+func testEditFileToNewBranch(t *testing.T, session *TestSession, user, repo, branch, targetBranch, filePath, newContent string) *TestResponse {
// Get to the 'edit this file' page
req := NewRequest(t, "GET", path.Join(user, repo, "_edit", branch, filePath))
@@ -157,11 +152,11 @@ func testEditFileToNewBranch(t *testing.T, session *TestSession, user, repo, bra
func TestEditFile(t *testing.T) {
prepareTestEnv(t)
session := loginUser(t, "user2")
- testEditFile(t, session, "user2", "repo1", "master", "README.md")
+ testEditFile(t, session, "user2", "repo1", "master", "README.md", "Hello, World (Edited)\n")
}
func TestEditFileToNewBranch(t *testing.T) {
prepareTestEnv(t)
session := loginUser(t, "user2")
- testEditFileToNewBranch(t, session, "user2", "repo1", "master", "feature/test", "README.md")
+ testEditFileToNewBranch(t, session, "user2", "repo1", "master", "feature/test", "README.md", "Hello, World (Edited)\n")
}