mirror of
https://codeberg.org/forgejo/forgejo.git
synced 2024-11-27 07:16:17 +00:00
d7268d7266
Refs: https://codeberg.org/forgejo/forgejo/pulls/1595 (cherry picked from commit35b962e631
) (cherry picked from commit1004e35b84
) (cherry picked from commitaf51dd594d
) (cherry picked from commit7fb66b4556
) (cherry picked from commit0c409950f1
) (cherry picked from commitedf1cb72b4
) (cherry picked from commitd1e5d9d664
)
41 lines
1.1 KiB
Go
41 lines
1.1 KiB
Go
// Copyright 2023 The Forgejo Authors. All rights reserved.
|
|
// SPDX-License-Identifier: MIT
|
|
|
|
package integration
|
|
|
|
import (
|
|
"net/http"
|
|
"testing"
|
|
|
|
"code.gitea.io/gitea/tests"
|
|
|
|
"github.com/stretchr/testify/assert"
|
|
)
|
|
|
|
func TestFeedPlainTextTitles(t *testing.T) {
|
|
// This test verifies that items' titles in feeds are generated as plain text.
|
|
// See https://codeberg.org/forgejo/forgejo/pulls/1595
|
|
|
|
t.Run("Feed plain text titles", func(t *testing.T) {
|
|
t.Run("Atom", func(t *testing.T) {
|
|
defer tests.PrepareTestEnv(t)()
|
|
|
|
req := NewRequest(t, "GET", "/user2/repo1.atom")
|
|
resp := MakeRequest(t, req, http.StatusOK)
|
|
|
|
data := resp.Body.String()
|
|
assert.Contains(t, data, "<title>the_1-user.with.all.allowedChars closed issue user2/repo1#4</title>")
|
|
})
|
|
|
|
t.Run("RSS", func(t *testing.T) {
|
|
defer tests.PrepareTestEnv(t)()
|
|
|
|
req := NewRequest(t, "GET", "/user2/repo1.rss")
|
|
resp := MakeRequest(t, req, http.StatusOK)
|
|
|
|
data := resp.Body.String()
|
|
assert.Contains(t, data, "<title>the_1-user.with.all.allowedChars closed issue user2/repo1#4</title>")
|
|
})
|
|
})
|
|
}
|