Check flash in tests

34 views
Skip to first unread message

joão

unread,
Nov 11, 2011, 9:47:13 PM11/11/11
to play-framework
Hello,

In some controller I'm doing:

flash.success(Messages.get(i18nKey));

In the Function test, I call the controller with:

POST(Router.reverse("Users.authenticate",
params));


Then check if there's any message in the Flash:

Flash.current().get("success")

But the Flash object is different when the controller executes and
when I check for the contents in the Test.

I migrated an application from 1.1 to 1.2. In 1.1 everything was ok.
Any change how I can check the value of flash in tests?

Thnaks,

joão

unread,
Nov 11, 2011, 10:15:36 PM11/11/11
to play-framework
Well,
Also accessing the current session, seems not to work in tests.
Scope.Session.current().get(SessionValuesConstants.LOGIN_EMAIL),
email);
In version 1.1 this worked ok. Am I missing something?
Reply all
Reply to author
Forward
0 new messages