Blueprints boy

The ultimate solution to managing test data.

View project on GitHub

Getting started

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

# Or use a shorthand

factory(Fruit).blueprint :apple, species: 'apple'

In test case:

it "has species 'apple'" do
  build :apple
  expect(apple.species).to eq('apple')
end