Skip to content

Commit

Permalink
fix compare time
Browse files Browse the repository at this point in the history
  • Loading branch information
6543 committed Sep 6, 2020
1 parent f4cec6c commit 452a24e
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion integrations/api_issue_stopwatch_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ package integrations
import (
"net/http"
"testing"
"time"

"code.gitea.io/gitea/models"
api "code.gitea.io/gitea/modules/structs"
Expand All @@ -29,8 +30,10 @@ func TestAPIListStopWatches(t *testing.T) {
stopwatch := models.AssertExistsAndLoadBean(t, &models.Stopwatch{UserID: owner.ID}).(*models.Stopwatch)
issue := models.AssertExistsAndLoadBean(t, &models.Issue{ID: stopwatch.IssueID}).(*models.Issue)
if assert.Len(t, apiWatches, 1) {
assert.EqualValues(t, stopwatch.CreatedUnix.AsTime().Unix(), apiWatches[0].Created.Unix())
apiWatches[0].Created = time.Time{}
assert.EqualValues(t, api.StopWatch{
Created: stopwatch.CreatedUnix.AsTime(),
Created: time.Time{},
IssueIndex: issue.Index,
IssueTitle: issue.Title,
RepoName: repo.Name,
Expand Down

0 comments on commit 452a24e

Please sign in to comment.