I'm in the process of writing test fixtures for our rails site. A lot of my tests require authentication, so I've had to port our permissions system into a fixture. Rather than type out all of the information for the fixture, I decided to create a nested loop that will take care of this for me.
There's probably a rake task for this, but I wasn't able to find it, so I came up with my own solution. You'll have to do a little cleanup when it's done, however some slight mods to this loop could even eliminate that.