 (t/deftest test-http-retrieve-profile
   (with-open [conn (up/get-conn)]
     (let [user (th/create-user conn 1)]
-      ;; Retrieve
       (with-server {:handler (urt/app)}
         (let [uri (str th/+base-url+ "/api/profile/me")
               [status data] (th/http-get user uri)]

(ns uxbox.tests.test-users
  (:require [clojure.test :as t]
            [promesa.core :as p]
            [clj-http.client :as http]
            [catacumba.testing :refer (with-server)]

          (t/is (= (:metadata data) "222"))
          (t/is (= (:email data) "user222@uxbox.io"))
          (t/is (not (contains? data :password))))))))


(t/deftest test-http-update-profile-photo
  (with-open [conn (up/get-conn)]
    (let [user (th/create-user conn 1)]
      (with-server {:handler (urt/app)}
        (let [uri (str th/+base-url+ "/api/profile/me/photo")
              params [{:name "sample.jpg"
                       :part-name "file"
                       :content (io/input-stream
                                 (io/resource "uxbox/tests/_files/sample.jpg"))}]
              [status data] (th/http-multipart user uri params)]
          (println "RESPONSE:" status data)
          (t/is (= 204 status)))))))

