How to put a value in flash when testing an action

I'm trying to test an action that needs a value stored in flash. def my_action if flash[:something].nil? redirect_to root_path if flash[:something] return end # Do some other stuff ...