… are evil if you expect the randomizer to give you unique values on each call.
Here’s an example:
before(:each) do
@user_1 = User.create!(email: "email-#{Random.rand(1000)}@example.com")
# the following will fail intermittently if you have a unique validation on User#email
@user_2 = User.create!(email: "email-#{Random.rand(1000)}@example.com")
end
It’s a timebomb, use it, it will haunt you later. Be sane, stop using random numbers in tests like this.