You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

24 lines
775 B

  1. // Copyright 2019 The Gitea Authors. All rights reserved.
  2. // Use of this source code is governed by a MIT-style
  3. // license that can be found in the LICENSE file.
  4. package integrations
  5. import (
  6. "net/url"
  7. "testing"
  8. "code.gitea.io/gitea/models"
  9. "code.gitea.io/gitea/modules/setting"
  10. )
  11. func TestRepoWatch(t *testing.T) {
  12. onGiteaRun(t, func(t *testing.T, giteaURL *url.URL) {
  13. // Test round-trip auto-watch
  14. setting.Service.AutoWatchOnChanges = true
  15. session := loginUser(t, "user2")
  16. models.AssertNotExistsBean(t, &models.Watch{UserID: 2, RepoID: 3})
  17. testEditFile(t, session, "user3", "repo3", "master", "README.md", "Hello, World (Edited for watch)\n")
  18. models.AssertExistsAndLoadBean(t, &models.Watch{UserID: 2, RepoID: 3, Mode: models.RepoWatchModeAuto})
  19. })
  20. }