Skip to Content Skip to Search Go to Top Navigation Go to Side Menu


Testing flash.now with rspec


Friday, September 26, 2008

I’ve spent a couple of hour trying to test a Rails controller. More specifically one of the action is suppose to display flash.now notice and I want to test that and it works. It took me awhile and some googling to realise that the content of a flash.now is deleted after the action, so that you cannot test it the same way as a normal flash (that last for the duration of the current action and the next one).

I came an across an elegant solution  to this problem as decribed on this blog.

Leave a Reply


In order to submit a comment, you need to mention your name and your email address (which won't be published). And ... don't forget your comment!

Comment Form