diff options
Diffstat (limited to 'yarns.webapp/900-implementations.yarn')
-rw-r--r-- | yarns.webapp/900-implementations.yarn | 19 |
1 files changed, 4 insertions, 15 deletions
diff --git a/yarns.webapp/900-implementations.yarn b/yarns.webapp/900-implementations.yarn index 859bb40..dba32e1 100644 --- a/yarns.webapp/900-implementations.yarn +++ b/yarns.webapp/900-implementations.yarn @@ -319,23 +319,12 @@ A POST request always has a body. The body consists of `foo=bar` pairs, separated by `&` signs. IMPLEMENTS WHEN (\S+) makes request POST (\S+) with (.*) - > "$DATADIR/response.headers" - > "$DATADIR/response.body" - port=$(cat "$DATADIR/webapp.port") + post_request "$MATCH_2" "$MATCH_3" - # The timestamp is needed by "THEN static status page got updated" - touch "$DATADIR/request.timestamp" +Except, sometimes we don't have a useful body to give. So we don't. - curl \ - -D "$DATADIR/response.headers" \ - -o "$DATADIR/response.body" \ - --silent --show-error \ - --request POST \ - --data "$MATCH_3" \ - "http://127.0.0.1:$port$MATCH_2" - cat "$DATADIR/response.headers" - cat "$DATADIR/response.body" - head -n1 "$DATADIR/response.headers" | grep '^HTTP/1\.[01] 200 ' + IMPLEMENTS WHEN (\S+) makes request POST (\S+) + post_request "$MATCH_2" dummy=value Check the Content-Type of the response has the desired type. |