I wrote a little application using GAE and the playframework.
I am trying to test the PUT method (used for updates) and when called
from a FunctionalTest it always returns with the login page even
though I login at the beginning of the test, that can be confirmed by
all the other method working fine.
It looks like when using the PUT method the session is lost
Anybody had similar problems?
I’m using play 1.1.1
It looks like there is a bug in FunctionalTest.
In all the methods (POST, GET, DELETE) there is the following line that carries over the cookies
This line is missing in PUT. Also because savedCookies is private you can’t access it in your tests.
The work around is to define the cookies map in your test as a private variable, set it to the login response cookies and then call POST with a new request using this cookies.
Here is my code