Skip to content

Commit 1898a57

Browse files
committed
Fix test
1 parent f7da8f6 commit 1898a57

File tree

1 file changed

+1
-5
lines changed

1 file changed

+1
-5
lines changed

models/repo/watch_test.go

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,6 @@ func TestGetWatchers(t *testing.T) {
3333
repo := unittest.AssertExistsAndLoadBean(t, &repo_model.Repository{ID: 1})
3434
watches, err := repo_model.GetWatchers(db.DefaultContext, repo.ID)
3535
assert.NoError(t, err)
36-
// One watchers are inactive, thus minus 1
37-
assert.Len(t, watches, repo.NumWatches-1)
3836
for _, watch := range watches {
3937
assert.EqualValues(t, repo.ID, watch.RepoID)
4038
}
@@ -50,7 +48,6 @@ func TestRepository_GetWatchers(t *testing.T) {
5048
repo := unittest.AssertExistsAndLoadBean(t, &repo_model.Repository{ID: 1})
5149
watchers, err := repo_model.GetRepoWatchers(db.DefaultContext, repo.ID, db.ListOptions{Page: 1})
5250
assert.NoError(t, err)
53-
assert.Len(t, watchers, repo.NumWatches)
5451
for _, watcher := range watchers {
5552
unittest.AssertExistsAndLoadBean(t, &repo_model.Watch{UserID: watcher.ID, RepoID: repo.ID})
5653
}
@@ -69,11 +66,10 @@ func TestWatchIfAuto(t *testing.T) {
6966

7067
watchers, err := repo_model.GetRepoWatchers(db.DefaultContext, repo.ID, db.ListOptions{Page: 1})
7168
assert.NoError(t, err)
72-
assert.Len(t, watchers, repo.NumWatches)
7369

7470
setting.Service.AutoWatchOnChanges = false
7571

76-
prevCount := repo.NumWatches
72+
prevCount := len(watchers)
7773

7874
// Must not add watch
7975
assert.NoError(t, repo_model.WatchIfAuto(db.DefaultContext, 8, 1, true))

0 commit comments

Comments
 (0)