Permalink
Browse files

test for form-encode and form-decode

  • Loading branch information...
1 parent e2d030d commit 4bd7933babad86d7f00530858e9e3287c6305320 Giacomo Ritucci committed Jan 15, 2012
Showing with 8 additions and 0 deletions.
  1. +8 −0 ring-core/test/ring/util/test/codec.clj
View
8 ring-core/test/ring/util/test/codec.clj
@@ -17,3 +17,11 @@
(deftest test-base64-encoding
(let [str-bytes (.getBytes "foo?/+" "UTF-8")]
(is (Arrays/equals str-bytes (base64-decode (base64-encode str-bytes))))))
+
+(deftest form-encoding
+ (let [encoded-params "p%2F1=v%2F1&p%2F2=v%2F21&p%2F2=v%2F22"]
+ (is (= (form-decode encoded-params)
+ (-> encoded-params
+ form-decode
+ form-encode
+ form-decode)))))

0 comments on commit 4bd7933

Please sign in to comment.