summaryrefslogtreecommitdiffstats
path: root/integrations/repofiles_update_test.go
diff options
context:
space:
mode:
author6543 <6543@obermui.de>2020-02-26 07:32:22 +0100
committerGitHub <noreply@github.com>2020-02-26 03:32:22 -0300
commit084a2b00268ed561f59ac19b1b6660a3c58573b3 (patch)
tree5474cb8c1bd5a16251edf46cd99d54757e3ebc0c /integrations/repofiles_update_test.go
parente5944a9521102c4917399a6550a0756919527944 (diff)
downloadgitea-084a2b00268ed561f59ac19b1b6660a3c58573b3.tar.gz
gitea-084a2b00268ed561f59ac19b1b6660a3c58573b3.zip
Code Refactor of IssueWatch related things (#10401)
* refactor * optimize * remove Iretating function LoadWatchUsers do not load Users into IW object and it is used only in api ... so move this logic * remove unessesary * Apply suggestions from code review Thx Co-Authored-By: guillep2k <18600385+guillep2k@users.noreply.github.com> * make Tests more robust * fix rebase * restart CI * CI no dont hit sqlites deadlock Co-authored-by: guillep2k <18600385+guillep2k@users.noreply.github.com>
Diffstat (limited to 'integrations/repofiles_update_test.go')
-rw-r--r--integrations/repofiles_update_test.go13
1 files changed, 8 insertions, 5 deletions
diff --git a/integrations/repofiles_update_test.go b/integrations/repofiles_update_test.go
index a7beec4955..c422483bf8 100644
--- a/integrations/repofiles_update_test.go
+++ b/integrations/repofiles_update_test.go
@@ -207,11 +207,14 @@ func TestCreateOrUpdateRepoFileForCreate(t *testing.T) {
commitID, _ := gitRepo.GetBranchCommitID(opts.NewBranch)
expectedFileResponse := getExpectedFileResponseForRepofilesCreate(commitID)
- assert.EqualValues(t, expectedFileResponse.Content, fileResponse.Content)
- assert.EqualValues(t, expectedFileResponse.Commit.SHA, fileResponse.Commit.SHA)
- assert.EqualValues(t, expectedFileResponse.Commit.HTMLURL, fileResponse.Commit.HTMLURL)
- assert.EqualValues(t, expectedFileResponse.Commit.Author.Email, fileResponse.Commit.Author.Email)
- assert.EqualValues(t, expectedFileResponse.Commit.Author.Name, fileResponse.Commit.Author.Name)
+ assert.NotNil(t, expectedFileResponse)
+ if expectedFileResponse != nil {
+ assert.EqualValues(t, expectedFileResponse.Content, fileResponse.Content)
+ assert.EqualValues(t, expectedFileResponse.Commit.SHA, fileResponse.Commit.SHA)
+ assert.EqualValues(t, expectedFileResponse.Commit.HTMLURL, fileResponse.Commit.HTMLURL)
+ assert.EqualValues(t, expectedFileResponse.Commit.Author.Email, fileResponse.Commit.Author.Email)
+ assert.EqualValues(t, expectedFileResponse.Commit.Author.Name, fileResponse.Commit.Author.Name)
+ }
})
}