hspec-wai icon indicating copy to clipboard operation
hspec-wai copied to clipboard

Testing with session

Open swr1bm86 opened this issue 9 years ago • 3 comments

Hi @sol, When I try to test an API actually needs the session, it will fail since the mock server can not reach the in-memory session. For instance, when testing with this test case, it will produce the error message:

image

Which is defined here, and it proves that the mock app can not reach out to the session when testing it, but it works fine when I start the server and test the API by hand.

Any ideas to fix this? Thanks in advance!

swr1bm86 avatar Nov 20 '16 16:11 swr1bm86

Where is the session stored? Cookies?

sol avatar Nov 21 '16 04:11 sol

@sol yes, exactly.

swr1bm86 avatar Nov 21 '16 05:11 swr1bm86

Hi @sol, I can solve this by pass around the cookie explicitly like this.

swr1bm86 avatar Nov 22 '16 03:11 swr1bm86