[rspec-users] flash.now

Ben Mabey ben at benmabey.com
Sun Mar 29 12:11:28 EDT 2009


Yi wrote:
> Hi,
>
> How can I test flash.now[:key] is being set in a controller test? Both 
> flash[:key] and flash.now[:key].should == message didn't work
>
> I can use response.session["flash"][:key].should == message . Just 
> looks bad
>
> Thanks
>
> Yi
>
> -- 
> http://yiwenandsoftware.wordpress.com


In the past I have used this article to test flash.now in rspec:
http://www.kerrybuckley.org/2007/07/04/correct-use-of-the-flash-in-rails/

Note, that the post is pretty old and so rspec-rails may support this 
out of the box by now.. I don't know though.

-Ben


More information about the rspec-users mailing list