Set flash in test session when necessary.

`to_session_value` returns nil when empty.
Merge pull request #15682 from tgxworld/controller_test_process

Set flash in test session when necessary.