Skip to content

Commit

Permalink
Add a test for :put requests with :form-params
Browse files Browse the repository at this point in the history
  • Loading branch information
dakrone committed Mar 9, 2012
1 parent 7f32470 commit 21bc966
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions test/clj_http/test/client.clj
Original file line number Diff line number Diff line change
Expand Up @@ -291,6 +291,13 @@
:param2 "value2"}})]
(is (= "param1=value1&param2=value2" (:body resp)))
(is (= "application/x-www-form-urlencoded" (:content-type resp)))
(is (not (contains? resp :form-params))))
(let [param-client (client/wrap-form-params identity)
resp (param-client {:request-method :put
:form-params {:param1 "value1"
:param2 "value2"}})]
(is (= "param1=value1&param2=value2" (:body resp)))
(is (= "application/x-www-form-urlencoded" (:content-type resp)))
(is (not (contains? resp :form-params)))))
(testing "Ensure it does not affect GET requests"
(let [param-client (client/wrap-form-params identity)
Expand Down

0 comments on commit 21bc966

Please sign in to comment.