summaryrefslogtreecommitdiffstats
path: root/models/issues/stopwatch_test.go
diff options
context:
space:
mode:
Diffstat (limited to 'models/issues/stopwatch_test.go')
-rw-r--r--models/issues/stopwatch_test.go12
1 files changed, 6 insertions, 6 deletions
diff --git a/models/issues/stopwatch_test.go b/models/issues/stopwatch_test.go
index fa937ecbed..39958a7f36 100644
--- a/models/issues/stopwatch_test.go
+++ b/models/issues/stopwatch_test.go
@@ -26,20 +26,20 @@ func TestCancelStopwatch(t *testing.T) {
issue2, err := issues_model.GetIssueByID(db.DefaultContext, 2)
assert.NoError(t, err)
- err = issues_model.CancelStopwatch(user1, issue1)
+ err = issues_model.CancelStopwatch(db.DefaultContext, user1, issue1)
assert.NoError(t, err)
unittest.AssertNotExistsBean(t, &issues_model.Stopwatch{UserID: user1.ID, IssueID: issue1.ID})
_ = unittest.AssertExistsAndLoadBean(t, &issues_model.Comment{Type: issues_model.CommentTypeCancelTracking, PosterID: user1.ID, IssueID: issue1.ID})
- assert.Nil(t, issues_model.CancelStopwatch(user1, issue2))
+ assert.Nil(t, issues_model.CancelStopwatch(db.DefaultContext, user1, issue2))
}
func TestStopwatchExists(t *testing.T) {
assert.NoError(t, unittest.PrepareTestDatabase())
- assert.True(t, issues_model.StopwatchExists(1, 1))
- assert.False(t, issues_model.StopwatchExists(1, 2))
+ assert.True(t, issues_model.StopwatchExists(db.DefaultContext, 1, 1))
+ assert.False(t, issues_model.StopwatchExists(db.DefaultContext, 1, 2))
}
func TestHasUserStopwatch(t *testing.T) {
@@ -68,11 +68,11 @@ func TestCreateOrStopIssueStopwatch(t *testing.T) {
issue2, err := issues_model.GetIssueByID(db.DefaultContext, 2)
assert.NoError(t, err)
- assert.NoError(t, issues_model.CreateOrStopIssueStopwatch(org3, issue1))
+ assert.NoError(t, issues_model.CreateOrStopIssueStopwatch(db.DefaultContext, org3, issue1))
sw := unittest.AssertExistsAndLoadBean(t, &issues_model.Stopwatch{UserID: 3, IssueID: 1})
assert.LessOrEqual(t, sw.CreatedUnix, timeutil.TimeStampNow())
- assert.NoError(t, issues_model.CreateOrStopIssueStopwatch(user2, issue2))
+ assert.NoError(t, issues_model.CreateOrStopIssueStopwatch(db.DefaultContext, user2, issue2))
unittest.AssertNotExistsBean(t, &issues_model.Stopwatch{UserID: 2, IssueID: 2})
unittest.AssertExistsAndLoadBean(t, &issues_model.TrackedTime{UserID: 2, IssueID: 2})
}