I just started using Shoulda's very nice RSpec custom matchers. They do a great job of trimming the fat off your specs. One thing I found missing though was a simple matcher to handle the Rails flash. A quick googling didn't turn up any simple matchers for this, so I put one together and pushed it to github -- rspec-flash-matcher.
It's a pretty straightforward matcher, and lets you reduce
to
If you like to test actual flash output, you can use
I plan to add regex support soon. Also, I have a suspicion that this won't work under Ruby 1.9 because of changes in how send
handles protected methods.