ring-mock
ring-mock copied to clipboard
Add support for mocking multipart uploads
A built-in support for mocking multipart uploads would be nice.
In #9, @danielcompton gives a workaround using Peridot's peridot.multipart/build:
(-> (ring.mock.request/request :post "/my-file-upload")
(merge (peridot.multipart/build {:data (io/file (io/resource "data.csv"))}))
(app))
Peridot's implementation uses org.apache.httpcomponents/httpmime.
Maybe a similar function signature like (ring.mock.request/multipart request map) could be used, where the map keys would be strings and values could be either strings or files.