This commit is contained in:
@@ -458,6 +458,8 @@ func TestQuestionPageRendersNestedPostControls(t *testing.T) {
|
||||
"Shop response",
|
||||
"Edited",
|
||||
`action="/posts"`,
|
||||
`data-submit-once`,
|
||||
`data-submit-button`,
|
||||
`action="/posts/` + root.ID + `/edit"`,
|
||||
`action="/posts/` + homeownerReply.ID + `/edit"`,
|
||||
`>The model number is 123A.</textarea>`,
|
||||
|
||||
@@ -168,6 +168,16 @@ func TestRegisterLoginAsk(t *testing.T) {
|
||||
if rec.Code != 200 {
|
||||
t.Fatalf("submit form %d", rec.Code)
|
||||
}
|
||||
for _, want := range []string{
|
||||
`src="/static/app.js"`,
|
||||
`id="submit-progress"`,
|
||||
`data-submit-once`,
|
||||
`data-submit-button`,
|
||||
} {
|
||||
if !strings.Contains(rec.Body.String(), want) {
|
||||
t.Fatalf("submit form missing %q: %s", want, rec.Body.String())
|
||||
}
|
||||
}
|
||||
csrf := csrfFrom(rec.Body.String())
|
||||
form := strings.NewReader("_csrf=" + csrf + "&title=Leaky+faucet&body=Drip+all+night.&city=Oakland")
|
||||
req = httptest.NewRequest(http.MethodPost, "/submit", form)
|
||||
|
||||
Reference in New Issue
Block a user