Skip to content

Instantly share code, notes, and snippets.

@borkdude
Created November 30, 2015 19:33
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save borkdude/d932f36e402ebae0269b to your computer and use it in GitHub Desktop.
Save borkdude/d932f36e402ebae0269b to your computer and use it in GitHub Desktop.
tests.clj
(testing "student can upload profile picture"
(with-redefs [s3/put-object (fn [& more] (println "s3 putting object"))
s3/delete-object (fn [& more] (println "s3 deleting object"))]
(let [profile-resp
(apply request @atm_logged-in-resp
(str "/users/"
(:id @atm_user)
"/profile/picture")
:request-method :put
(apply concat
(peridot.multipart/build {"picture" (io/file (io/resource "nikita.jpg"))})))
profile (edn/read-string (-> profile-resp :response :body))]
(println profile)
;; TODO: write assertions
)
(let [profile-resp
(request @atm_logged-in-resp
(str "/users/"
(:id @atm_user)
"/profile/picture")
:request-method :put
:params {"picture" (io/file (io/resource "nikita.jpg"))})
profile (edn/read-string (-> profile-resp :response :body))]
(println profile)
;; TODO: write assertions
)))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment