<p>There are a dozen Rails plugins whose goal is to replace fixtures in testing. Here are a few I can think of:</p>

<ul>
<li>fixture replacement</li>
<li>factory girl</li>
<li>factories and workers</li>
<li>rails scenarios</li>
<li>fixture-scenarios</li>
<li>object daddy</li>
</ul>

<p>There are probably others. Which of these plugins do you prefer and why?</p>

I personally use
Faker
with a custom Factory class. This allows me to create my factories, and populate the generated instances with non-static data.
```
```
# spec/factory.rb
module Factory
  def self.create_offer(options={})
    Offer.create({
      :code => Faker::Lorem.words(1),
      :expires_on => Time.now + (rand(30) + 1).day
    }.merge(options))
  end
end

# spec_helper.rb
require 'faker'
require 'spec/factory'

# In the specs
@offer = Factory.create_offer(:code => 'TESTING')
```
```