Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Add values to Session during testing (FakeRequest, FakeApplication)

I'm trying to build some tests around a method that reads some data from the session.

I tried extending FakeRequest and overriding the session value, but I get an error on compilation saying that session has to be a val when overriden, which won't work.

How can I modify a FakeRequest() to add values to the session?

like image 909
Pere Villega Avatar asked Mar 17 '12 20:03

Pere Villega


1 Answers

There is a pull request about this functionality

See https://github.com/playframework/Play20/pull/103

like image 90
Julien Lafont Avatar answered Sep 19 '22 05:09

Julien Lafont