In spec/spec_helper.rb or test/test_helper.rb:
spec/spec_helper.rb
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