Add separate production, testserver, and demo deployments
CI / test (push) Failing after 10s

This commit is contained in:
2026-09-14 19:58:31 +02:00
parent b87aa0aa17
commit d06ff4a94a
37 changed files with 1293 additions and 121 deletions
+21
View File
@@ -128,6 +128,27 @@ func TestGardenContextIsKeptInAccountAndSettingsLinks(t *testing.T) {
}
}
func TestProtectedDemoAccountHidesAccountMutationForms(t *testing.T) {
app := newTestApplication(t)
user := client.User{ID: 1, Name: "Demo", Email: "demo@example.com", Activated: true}
data := &templateData{
commonTemplateData: commonTemplateData{IsAuthenticated: true, IsActivated: true, CurrentUser: &user, Form: accountForm{Errors: map[string]string{}}},
accountTemplateData: accountTemplateData{AccountProtected: true},
}
response := httptest.NewRecorder()
app.render(response, http.StatusOK, "account.tmpl", data)
body := response.Body.String()
if !strings.Contains(body, "Gemeinsames Demokonto") {
t.Fatalf("protected account notice is missing: %s", body)
}
for _, forbidden := range []string{"action='/account/profile'", "action='/account/password'", "action='/account/email'", "Widerrufen"} {
if strings.Contains(body, forbidden) {
t.Errorf("protected account still offers %q: %s", forbidden, body)
}
}
}
func TestAdminTemplateKeepsSelectedGardenInNavigationAndForms(t *testing.T) {
app := newTestApplication(t)
user := client.User{ID: 1, Name: "Alice", Activated: true, Permissions: []string{"roles:manage"}}