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.

api_feed_user_test.go 812B

12345678910111213141516171819202122232425262728293031323334353637
  1. // Copyright 2022 The Gitea Authors. All rights reserved.
  2. // SPDX-License-Identifier: MIT
  3. package integration
  4. import (
  5. "net/http"
  6. "testing"
  7. "code.gitea.io/gitea/tests"
  8. "github.com/stretchr/testify/assert"
  9. )
  10. func TestFeed(t *testing.T) {
  11. t.Run("User", func(t *testing.T) {
  12. t.Run("Atom", func(t *testing.T) {
  13. defer tests.PrepareTestEnv(t)()
  14. req := NewRequest(t, "GET", "/user2.atom")
  15. resp := MakeRequest(t, req, http.StatusOK)
  16. data := resp.Body.String()
  17. assert.Contains(t, data, `<feed xmlns="http://www.w3.org/2005/Atom"`)
  18. })
  19. t.Run("RSS", func(t *testing.T) {
  20. defer tests.PrepareTestEnv(t)()
  21. req := NewRequest(t, "GET", "/user2.rss")
  22. resp := MakeRequest(t, req, http.StatusOK)
  23. data := resp.Body.String()
  24. assert.Contains(t, data, `<rss version="2.0"`)
  25. })
  26. })
  27. }