We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 2886822 commit 211a76dCopy full SHA for 211a76d
integrations/google_analytics_test.go
@@ -0,0 +1,22 @@
1
+package integrations
2
+
3
+import (
4
+ "net/http"
5
+ "testing"
6
7
+ "code.gitea.io/gitea/modules/setting"
8
9
+ "github.com/stretchr/testify/assert"
10
+)
11
12
+func TestGoogleAnalytics(t *testing.T) {
13
+ // test that the google analytics javascript is included in HTML
14
+ prepareTestEnv(t)
15
+ setting.Google.GATrackingID = "UA-012345-6"
16
17
+ req := NewRequest(t, "GET", "/")
18
+ resp := MakeRequest(t, req, http.StatusOK)
19
+ htmlDoc := NewHTMLParser(t, resp.Body)
20
+ scripts := htmlDoc.doc.Find("script").Text()
21
+ assert.Contains(t, scripts, setting.Google.GATrackingID)
22
+}
0 commit comments