I want to create a sequence without creating a model Foo:
let( :foo_id ){ sequence...? }
The following code works, but creates a model Foo.
Factory:
FactoryGirl.define do
sequence :id do |i|
i
end
factory :foo do
id
text { 'Text'}
end
end
In spec:
let( :foo ){ create :foo )
...
# Using foo.id
How to create a numeric sequence without a model?
FactoryGirl does not support this, but Fabrication does.
Take a look at this documentation.
If you place such a statement in your
let, you will get a new number every time: