postForm submits a form-encoded POST to the given URL and returns the response. Mirrors what a browser does when the confirmation page's form is submitted.
(t *testing.T, url string, values map[string]string)
| 100 | // response. Mirrors what a browser does when the confirmation page's |
| 101 | // form is submitted. |
| 102 | func postForm(t *testing.T, url string, values map[string]string) *http.Response { |
| 103 | t.Helper() |
| 104 | form := make(map[string][]string, len(values)) |
| 105 | for k, v := range values { |
| 106 | form[k] = []string{v} |
| 107 | } |
| 108 | resp, err := http.PostForm(url, form) |
| 109 | if err != nil { |
| 110 | t.Fatal(err) |
| 111 | } |
| 112 | return resp |
| 113 | } |
| 114 | |
| 115 | // --- GET confirmation page behavior --- |
| 116 |
no test coverage detected