mirror of
https://github.com/penpot/penpot.git
synced 2025-06-24 17:56:59 +02:00
✨ Update yetti and adapt for ring-2.0
This commit is contained in:
parent
7a33817c22
commit
bb5a4c0fa5
23 changed files with 407 additions and 440 deletions
|
@ -31,17 +31,17 @@
|
|||
|
||||
request (volatile! nil)
|
||||
handler (#'app.http.access-token/wrap-soft-auth
|
||||
(fn [req & _] (vreset! request req))
|
||||
(fn [req] (vreset! request req))
|
||||
system)]
|
||||
|
||||
(with-mocks [m1 {:target 'app.http.access-token/get-token
|
||||
:return nil}]
|
||||
(handler {} nil nil)
|
||||
(handler {})
|
||||
(t/is (= {} @request)))
|
||||
|
||||
(with-mocks [m1 {:target 'app.http.access-token/get-token
|
||||
:return (:token token)}]
|
||||
(handler {} nil nil)
|
||||
(handler {})
|
||||
|
||||
(let [token-id (get @request :app.http.access-token/id)]
|
||||
(t/is (= token-id (:id token))))))))
|
||||
|
|
|
@ -25,7 +25,7 @@
|
|||
|
||||
(def http-request
|
||||
(reify
|
||||
yetti.request/Request
|
||||
ring.request/Request
|
||||
(get-header [_ name]
|
||||
(case name
|
||||
"x-forwarded-for" "127.0.0.44"))))
|
||||
|
|
|
@ -46,6 +46,6 @@
|
|||
{:keys [error result]} (th/command! (assoc params ::cond/key etag))]
|
||||
(t/is (nil? error))
|
||||
(t/is (fn? result))
|
||||
(t/is (= 304 (-> (result nil) :yetti.response/status))))
|
||||
(t/is (= 304 (-> (result nil) :ring.response/status))))
|
||||
))))
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue