mirror of
https://codeberg.org/forgejo/forgejo.git
synced 2024-11-10 01:05:14 +00:00
Improve testing
This commit is contained in:
parent
4437292622
commit
56a028ec96
|
@ -4,6 +4,7 @@
|
|||
package integration
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"net/http"
|
||||
"testing"
|
||||
|
||||
|
@ -290,7 +291,7 @@ func TestGetOpenStreetMapLink(t *testing.T) {
|
|||
|
||||
session := loginUser(t, "user2")
|
||||
for location, encodedLocation := range testLocations {
|
||||
t.Logf("Testing location %s", location)
|
||||
t.Run(location, func(t *testing.T) {
|
||||
req := NewRequestWithValues(t, "POST", "/user/settings", map[string]string{
|
||||
"_csrf": GetCSRF(t, session, "/user/settings"),
|
||||
"name": "user2",
|
||||
|
@ -302,9 +303,9 @@ func TestGetOpenStreetMapLink(t *testing.T) {
|
|||
|
||||
req = NewRequest(t, "GET", "/user2/")
|
||||
resp := session.MakeRequest(t, req, http.StatusOK)
|
||||
assert.Contains(t,
|
||||
resp.Body.String(),
|
||||
"<a href=\""+"https://www.openstreetmap.org/search?query="+encodedLocation+"\" rel=\"nofollow noreferrer\">",
|
||||
)
|
||||
htmlDoc := NewHTMLParser(t, resp.Body)
|
||||
|
||||
htmlDoc.AssertElement(t, fmt.Sprintf("a[href='https://www.openstreetmap.org/search?query=%s']", encodedLocation), true)
|
||||
})
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue