Question

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?

Was it helpful?

Solution

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.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top