For all users in our system, we generate a private/public key pair, which often takes a second or two. That’s not a deal breaker on the live site, but it makes running the tests extremely slow, and slow tests won’t get run.
Our setup is Rails 3.1 with factory_girl and rspec.
I tried creating (10 or so) some ahead of time with a method to return a random one, but this seems to be problematic: perhaps they’re getting cleared out of the database and are unavailable for subsequent tests… I’m not sure.
This might be useful: https://github.com/pcreux/rspec-set – any other ideas?
https://github.com/pcreux/rspec-set was good enough for what we need, combined with an after/all block to clean up after the droppings it leaves in the database.