Say, you write something like this in your webflow:
... if (some_condition) { flash.message = "my error message" return error() } ...
To access this in the GSP page, you use:
<g:if test="${message}"> ... </g:if>
instead of the usual
<g:if test="${flash.message}"> ... </g:if>
due to the issue with accessing flash-scoped objects with webflows. Now, the question is, while writing tests, how do you go about accessing this object?
Instead of using controller.flash.message, do this instead:
void testSomething() { assertTrue controller.request.message ==~ /some text/ }
… which does the trick 😉