-
-
Save borkdude/d932f36e402ebae0269b to your computer and use it in GitHub Desktop.
tests.clj
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(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