As per the suggestion by James Reeves through twitter, I was able to solve this problem by using peridot. It has session handling for writing tests.
How to handle session in Clojure web application tests written with ring-mock?
-
14-07-2023 - |
문제
In my application, I need a functionality where one request fetches a token(random string) from the server which is stored in the session and the second request is made with this token.
When I make the requests in my tests using ring-mock, the second request says the token is not in session. I assume both requests are independent in test scenario.
How do I maintain a session when issuing multiple requests using ring-mock for writing tests? Or is there any other library that I can use for tests in such cases?
해결책
제휴하지 않습니다 StackOverflow