Blueprints

Home

In spec/spec_helper.rb or test/test_helper.rb:

Blueprints.enable

In spec/blueprint.rb or test/blueprint.rb:

blueprint :apple do
  Fruit.create!(:species => 'apple')
end

In test case:

it "should have species 'apple'" do
  build :apple
  @apple.species.should == 'apple'
end