Today I Learned
by OneCode

Second param for a sequence in factory_girl

If you are using factory_girl, you are probably familiar with sequence method.

Did you know it can take the second argument, which is its starting value? You can pass there a String, Fixnum, or anything else that can be incremented by a next method.

FactoryGirl.define do
  sequence(:name, 'a') { |n| "Person #{n}"}
end

generate :name
# => "Person a"

generate :name
# => "Person b"