I seem to have an annoying habit of realizing that I’ve asked a
question with a blindingly obvious answer just after I’ve asked it
but here goes.
I’ve noticed that in my functional tests there’s the occasional
reliance on the contents of the flash. For example, I have an action
that confirms a users identity and may reject them because
A) The credentials were bad - flash contains “Sorry, I have no record
B) For the sake of argument, the controller deliberately stops 20% of
users logging in - flash contains “You’re not getting in because I
In both these cases the only thing that varies from the user side
(and therefore the functional test) is the flash. However, this
seems to be extremely brittle to me: if I were to change the message
then the tests fail. Is there a preferred way to cope with this
other than refactoring my tests not to use the flash?
The best solution I can come up with is to keep all interface text in
a external gettext file and compare the flash and the expected value
I now fully expect to find an answer as soon as I press ‘send’.