aboutsummaryrefslogtreecommitdiffstats
path: root/models/repo/watch_test.go
diff options
context:
space:
mode:
Diffstat (limited to 'models/repo/watch_test.go')
-rw-r--r--models/repo/watch_test.go14
1 files changed, 7 insertions, 7 deletions
diff --git a/models/repo/watch_test.go b/models/repo/watch_test.go
index 2ff3ced2dc..2f4e04ab17 100644
--- a/models/repo/watch_test.go
+++ b/models/repo/watch_test.go
@@ -73,13 +73,13 @@ func TestWatchIfAuto(t *testing.T) {
prevCount := repo.NumWatches
// Must not add watch
- assert.NoError(t, WatchIfAuto(8, 1, true))
+ assert.NoError(t, WatchIfAuto(db.DefaultContext, 8, 1, true))
watchers, err = GetRepoWatchers(repo.ID, db.ListOptions{Page: 1})
assert.NoError(t, err)
assert.Len(t, watchers, prevCount)
// Should not add watch
- assert.NoError(t, WatchIfAuto(10, 1, true))
+ assert.NoError(t, WatchIfAuto(db.DefaultContext, 10, 1, true))
watchers, err = GetRepoWatchers(repo.ID, db.ListOptions{Page: 1})
assert.NoError(t, err)
assert.Len(t, watchers, prevCount)
@@ -87,31 +87,31 @@ func TestWatchIfAuto(t *testing.T) {
setting.Service.AutoWatchOnChanges = true
// Must not add watch
- assert.NoError(t, WatchIfAuto(8, 1, true))
+ assert.NoError(t, WatchIfAuto(db.DefaultContext, 8, 1, true))
watchers, err = GetRepoWatchers(repo.ID, db.ListOptions{Page: 1})
assert.NoError(t, err)
assert.Len(t, watchers, prevCount)
// Should not add watch
- assert.NoError(t, WatchIfAuto(12, 1, false))
+ assert.NoError(t, WatchIfAuto(db.DefaultContext, 12, 1, false))
watchers, err = GetRepoWatchers(repo.ID, db.ListOptions{Page: 1})
assert.NoError(t, err)
assert.Len(t, watchers, prevCount)
// Should add watch
- assert.NoError(t, WatchIfAuto(12, 1, true))
+ assert.NoError(t, WatchIfAuto(db.DefaultContext, 12, 1, true))
watchers, err = GetRepoWatchers(repo.ID, db.ListOptions{Page: 1})
assert.NoError(t, err)
assert.Len(t, watchers, prevCount+1)
// Should remove watch, inhibit from adding auto
- assert.NoError(t, WatchRepo(12, 1, false))
+ assert.NoError(t, WatchRepo(db.DefaultContext, 12, 1, false))
watchers, err = GetRepoWatchers(repo.ID, db.ListOptions{Page: 1})
assert.NoError(t, err)
assert.Len(t, watchers, prevCount)
// Must not add watch
- assert.NoError(t, WatchIfAuto(12, 1, true))
+ assert.NoError(t, WatchIfAuto(db.DefaultContext, 12, 1, true))
watchers, err = GetRepoWatchers(repo.ID, db.ListOptions{Page: 1})
assert.NoError(t, err)
assert.Len(t, watchers, prevCount)