             [posthere.app :refer (app)]
             [posthere.capture-request :refer (post-response-body)]
             [posthere.storage :refer (requests-for)]))
+
+(def string-body "I'm a little teapot.")
+(def json-body "{\"lyric\": \"I'm a little teapot.\"}")
+(def xml-body "<song><lyric>I'm a little teapot.</lyric></song>")
+
+(def query-params "foo=bar&ferrets=evolved")
 
 (defn url-for [url-uuid]
   (str "/" url-uuid))

    
    (fact "without a body"
      (let [url-uuid (uuid)
            url (url-for (str url-uuid "?foo=bar&ferrets=evolved"))
            request (request :post url)
            response (app request)]
        (:query-string (first (requests-for url-uuid))) => "foo=bar&ferrets=evolved"))
    
    (fact "with a body"
      (let [url-uuid (uuid)
          url (url-for (str url-uuid "?foo=bar&ferrets=evolved"))
          request (request :post url)
          body (body request "I'm a little teapot.")
          response (app body)]
        (:query-string (first (requests-for url-uuid))) => "foo=bar&ferrets=evolved")))

  ; POST saves BODY content
  (facts "body is saved"

      (let [url-uuid (uuid)
            url (url-for url-uuid)
            request (request :post url)
            body (body request string-body)
            response (app body)]
          (:body (first (requests-for url-uuid))) => string-body))

    (fact "JSON body is saved"
      (let [url-uuid (uuid)
            url (url-for url-uuid)
            request (request :post url)
            body (body request json-body)
            response (app body)]
          (:body (first (requests-for url-uuid))) => json-body))

    (fact "XML body is saved"
      (let [url-uuid (uuid)
            url (url-for url-uuid)
            request (request :post url)
            body (body request xml-body)
            response (app body)]
          (:body (first (requests-for url-uuid))) => xml-body))))


(future-facts "about giant POSTs getting partially saved"

