如何模拟对参数化解放器资源的请求?这是我的代码:
(defresource lookup [id]
:available-media-types ["application/json"]
:allowed-methods [:get]
:handle-ok #(lookup-event id))
(event/lookup (ring.mock.request/request :get "/event/1" ))
我只是回来而不是回复。你能告诉我这里我做错了什么吗?
答案 0 :(得分:1)
原来这是正确的做法。
((event/lookup 1) (ring.mock.request/request :get "/event/1" ))