Skip to content

Commit 6ffe439

Browse files
committed
Fix test
1 parent cb98242 commit 6ffe439

File tree

2 files changed

+16
-14
lines changed

2 files changed

+16
-14
lines changed

services/repository/files/content_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ func getExpectedReadmeContentsResponse() *api.ContentsResponse {
3939
LastCommitSHA: "65f1bf27bc3bf70f64657658635e66094edbcb4d",
4040
LastCommitterDate: time.Date(2017, time.March, 19, 16, 47, 59, 0, time.FixedZone("", -14400)),
4141
LastAuthorDate: time.Date(2017, time.March, 19, 16, 47, 59, 0, time.FixedZone("", -14400)),
42-
LastCommitMessage: "Initial commit",
42+
LastCommitMessage: "Initial commit\n",
4343
Type: "file",
4444
Size: 30,
4545
Encoding: &encoding,

tests/integration/repofiles_change_test.go

Lines changed: 15 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -198,7 +198,7 @@ func getExpectedFileResponseForRepoFilesCreate(commitID string, lastCommit *git.
198198
SHA: "65f1bf27bc3bf70f64657658635e66094edbcb4d",
199199
},
200200
},
201-
Message: "Updates README.md\n",
201+
Message: "Creates new/file.txt\n",
202202
Tree: &api.CommitMeta{
203203
URL: setting.AppURL + "api/v1/repos/user2/repo1/git/trees/f93e3a1a1525fb5b91020da86e44810c87a2d7bc",
204204
SHA: "f93e3a1a1525fb5b91020git dda86e44810c87a2d7bc",
@@ -228,6 +228,7 @@ func getExpectedFileResponseForRepoFilesUpdate(commitID, filename, lastCommitSHA
228228
LastCommitSHA: lastCommitSHA,
229229
LastCommitterDate: lastCommitterWhen,
230230
LastAuthorDate: lastAuthorWhen,
231+
LastCommitMessage: "Updates README.md\n",
231232
Type: "file",
232233
Size: 43,
233234
Encoding: &encoding,
@@ -328,18 +329,19 @@ func getExpectedFileResponseForRepoFilesUpdateRename(commitID, lastCommitSHA str
328329
downloadURL := setting.AppURL + "user2/lfs/raw/branch/master/" + detail.filename
329330
// don't set time related fields because there might be different time in one operation
330331
responses = append(responses, &api.ContentsResponse{
331-
Name: detail.filename,
332-
Path: detail.filename,
333-
SHA: detail.sha,
334-
LastCommitSHA: lastCommitSHA,
335-
Type: "file",
336-
Size: detail.size,
337-
Encoding: util.ToPointer("base64"),
338-
Content: &detail.content,
339-
URL: &selfURL,
340-
HTMLURL: &htmlURL,
341-
GitURL: &gitURL,
342-
DownloadURL: &downloadURL,
332+
Name: detail.filename,
333+
Path: detail.filename,
334+
SHA: detail.sha,
335+
LastCommitSHA: lastCommitSHA,
336+
LastCommitMessage: "Rename files\n",
337+
Type: "file",
338+
Size: detail.size,
339+
Encoding: util.ToPointer("base64"),
340+
Content: &detail.content,
341+
URL: &selfURL,
342+
HTMLURL: &htmlURL,
343+
GitURL: &gitURL,
344+
DownloadURL: &downloadURL,
343345
Links: &api.FileLinksResponse{
344346
Self: &selfURL,
345347
GitURL: &gitURL,

0 commit comments

Comments
 (0)